Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

604.Text data calculation -- How to calculate SUM of EMAs and Covariance of close value from stock data?

User: editor -- 2010-09-02          << 603  605 >>
Hits: 1910
Type: Text data calculation   
Search all Text data calculation examples
Description:
How to calculate SUM of EMAs and Covariance of close value from stock data?

COVAR - Covariance (Population Covariance)
Syntax
COVAR(Array1, Array2)

pr:= Close;
m1:= Mov(pr,3,E);... m12:= Mov(pr,60,E);

mvst:= (m1+m2+m3+m4+m5+m6)/6;
mvlt:= (m7+m8+m9+m10+m11+m12)/6;
MV:= (mvst+mvlt)/2;
SD:= Sqrt(
( Power(m1-mv,2)+Power(m2-mv,2)+...+Power(m12-mv,2) )/12 );
)+Power(m12-mv,2) )/12 );

CoV:= 100*SD/MV;
EMA_SUM1:=(m1+m2+m3+m4+m5+m6);
EMA_SUM2:=(m7+m8+m9+m10+m11+m12);
Input Sample:
CODE,DATE,OPEN,HIGH,LOW,CLOSE,VOLUME 
AIQ,12/16/09,6.18,6.18,5.99,6.05,16330 
AIQ,12/17/09,6.03,6.08,6.00,6.06,74300 
AIQ,12/18/09,5.66,5.74,5.14,5.51,1677700 
AIQ,12/21/09,5.51,5.60,5.45,5.47,388200 
AIQ,12/22/09,5.48,5.72,5.48,5.72,336178 
Output Sample:
DATE TIME OPEN HIGH LOW VOLUME CLOSE EMA_SUM1 EMA_SUM2 SUM1>=SUM2 SUM1<SUM2 COVAR
12/16/09 00:00 6.18 6.18 5.99 16330 6.05 0.00 0.00 1 0 0 
12/17/09 00:00 6.03 6.08 6.00 74300 6.06 0.00 0.00 1 0 0 
12/18/09 00:00 5.66 5.74 5.14 1677700 5.51 5.78 0.00 1 0 331.66 
12/21/09 00:00 5.51 5.60 5.45 388200 5.47 5.58 0.00 1 0 331.66 
12/22/09 00:00 5.48 5.72 5.48 336178 5.72 11.28 0.00 1 0 223.61 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source stock file
2. ctrl-h open replace window
* set 'replace scope' to line
* in 'search for pattern', enter:

* in 'replace with pattern', enter:

3. click "Advanced" page, enter "run following for each matched unit" as:

4. click "Replace", done!

Download Script:  scripts/604.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to calculate OBV(On Balance Volume) base on stock data? (66%)
How to calculate the summaries of different EMA based on close values in stock? (65%)
How to calculate CFMO 15 and CFMO 21 from csv file of stock data? (64%)
How to generate EMA columns and related STD of close value from stock data? (62%)
How to calculate Acc/Dis, OBV and related MA values of stock data? (61%)
How to calculate Parabolic SAR on a 5 days basis of stock data? (59%)
How to calculate Williams %R from stock data? (57%)
How to calculate Acc/Dis and corresponding 24 days' MA base on stock data? (55%)

Check Demo of Text data calculation
Keywords:
sum of emas  101  power  rar  ray  pop  array  calculate sum  syntax  tax  search calculate replace  search replace calculate  line data  replace line data  search data  replace with data  value line  data replace