Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

371.Text data calculation -- How to produce two new columns: MACD(12,26) and MACD EMA(9) on stock data?

User: editor -- 2009-12-21          << 370  372 >>
Hits: 403
Type: Text data calculation   
Search all Text data calculation examples
Description:
There is a column of daily close value of stock data. How to perform a calculation, specifically the math MACD, that produces two columns of new
data: MACD (12, 26 averages) and MACD EMA (9 average)?
Input Sample:
Close
33.22
33.33
34.20
34.23
35.22
36.00
35.00
35.22
Output Sample:
Close EMA[12]-EMA[26] EMA[9]ofMACD
33.22 2.65 0.53
33.33 4.98 1.48
34.20 7.04 2.74
34.23 8.77 4.19
35.22 10.23 5.75
36.00 11.41 7.32
35.00 12.14 8.78
35.22 12.55 10.05
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 "Line"
set "Replace with Pattern" to: 

click "Advanced" page, 
set "Run following for each matched unit" to:

3. Click 'Replace' button, you will get 2 additional column with MACD(12,26) and MACD EMA(9).
4. ctrl-s save to file.

Note: you can also click "Batch..." button in step 3, if you need process multiple files.
Download Script:  scripts/371.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to add a column of Close Location Value("CLV") on stock data? (50%)
How to generate Money Flow Index (MFI) and Moving Average from stock data? (49%)
How to generate EMA columns and related STD of close value from stock data? (48%)
How to add MACD, EMA, FAST%K, SLOW%D columns for CSV file of stock data? (48%)
How to calculate Elder's Force Index (EFI) and related MA, EMA for stock data? (46%)
How to calculate Acc/Dis and corresponding 24 days' MA base on stock data? (44%)
How to calculate OBV(On Balance Volume) base on stock data? (44%)
How to extract column 3,6,7,8 from each line of text? (43%)

Check Demo of Text data calculation
Keywords:
macd  macd ema  math  addition  average  rage  specific  stock  toc  process  two columns match  two files  calculation on stock data  2 columns  get value match  get value  match column  column match