Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

597.Advanced search and replace -- How to convert stock data (OHLCV) base on The Heikin Ashi modified formula?

User: editor -- 2010-08-25          << 596  598 >>
Hits: 265
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to convert stock data (OHLCV) base on The Heikin Ashi modified formula?

convert (OHLCV) to The Heikin Ashi modified formula:

xClose = (Open+High+Low+Close)/4
Average price of the current bar

xOpen = [xOpen(Previous Bar) + xClose(Previous Bar)]/2
Midpoint of the previous bar

xHigh = Max(High, xOpen, xClose)
Highest value in the set

xLow = Min(Low, xOpen, xClose)
Lowest value in the set
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 xClose xOpen xHigh xLow
12/16/09 00:00 6.18 6.18 5.99 16330 6.05 6.10 0.00 6.18 0.00
12/17/09 00:00 6.03 6.08 6.00 74300 6.06 6.04 3.05 6.08 3.05
12/18/09 00:00 5.66 5.74 5.14 1677700 5.51 5.51 4.55 5.74 4.55
12/21/09 00:00 5.51 5.60 5.45 388200 5.47 5.51 5.03 5.60 5.03
12/22/09 00:00 5.48 5.72 5.48 336178 5.72 5.60 5.27 5.72 5.27
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/597.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to convert database file into "|" delimitered file? (56%)
How to convert the text format by user specified rules? (55%)
How to convert a text file to specified format? (54%)
How to convert each line of a text file to the new format? (51%)
How to convert date from seconds passed since 1970 to YMD format? (49%)
How to batch reorganize stock data from CSV to TXT and add MACD and EMA? (47%)
How to parse data from the text file and create text with  user specified format? (47%)
How to convert the text from decimal to hex in a file? (47%)

Check Demo of Advanced search and replace
Keywords:
price  previous  average  current  rage  max  toc  stock  scope  replace scope  data base  search and replace convert  convert text  replace convert  replace with data  data replace  search and replace open source  search and replace text