Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

602.Text data calculation -- How to calculate the summaries of different EMA based on close values in stock?

User: editor -- 2010-08-30          << 601  603 >>
Hits: 398
Type: Text data calculation   
Search all Text data calculation examples
Description:
How to calculate the summaries of different EMA based on close values in stock?

===== Column1 ========
Value1:=(Mov(CLOSE,3,E)+Mov(CLOSE,5,E)+Mov(CLOSE,8,E)+ Mov(CLOSE,10,E)+Mov(CLOSE,12,E)+Mov(CLOSE,15,E));
===== Column2 ========
Value2:=(Mov(CLOSE,30,E)+Mov(CLOSE,35,E)+Mov(CLOSE,40,E)+Mov(CLOSE,45,E)+Mov(CLOSE,50,E)+Mov(CLOSE,60,E));
===== Column3(logic 1 or 0) ========
Value1-Value2>=0
===== Column4(logic 1 or 0)========
Value1-Value2<0


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
12/16/09 00:00 6.18 6.18 5.99 16330 6.05 0.00 0.00 1 0
12/17/09 00:00 6.03 6.08 6.00 74300 6.06 0.00 0.00 1 0
12/18/09 00:00 5.66 5.74 5.14 1677700 5.51 5.78 0.00 1 0
12/21/09 00:00 5.51 5.60 5.45 388200 5.47 5.58 0.00 1 0
12/22/09 00:00 5.48 5.72 5.48 336178 5.72 11.28 0.00 1 0
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open replace window
* set replace unit to 'chars'
* set replace scope to 'Line'
* in 'Search for pattern', enter:

* in 'replace with pattern', enter:

* click 'advanced' page, set 'run following for each matched unit' to:

3. click 'Replace', done!
Download Script:  scripts/602.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to calculate SUM of EMAs and Covariance of close value from stock data? (66%)
How to generate 12 columns EMA with different periods based on "close" value? (64%)
How to calculate Acc/Dis, OBV and related MA values of stock data? (60%)
How to calculate the summaries of every line in a txt file? (56%)
How to count how many IP addresses with different classes from web logs? (55%)
How to calculate the percentage of the number in the column1? (54%)
How to calculate the area of triangles base on 3 sides automatically? (54%)
How to calculate the summary of all numbers in multiple files? (54%)

Check Demo of Text data calculation
Keywords:
101  ies  stock  toc  calculate  else  calculation  calcu  values  scope  calculation on stock data  calculate text data  replace different  replace with data  data replace  chars replace  replace text pattern  text pattern