Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

525.Text data calculation -- How to calculate OBV(On Balance Volume) base on stock data?

User: editor -- 2010-06-03          << 524  526 >>
Hits: 579
Type: Text data calculation   
Search all Text data calculation examples
Description:
Can Mind Pioneer perform a calculation as in script 372,
specifically the math OBV (On Balance Volume)
to produces two columns of data, Today OBV and Yesterday OBV?

Formulas:
If today's price close > yesterday's price close then OBV =
yesterday's OBV + today's volume.
If today's price close < yesterday's price close then OBV =
yesterday's OBV - today's volume.
If today's price close = yesterday's price close then OBV =
yesterday's OBV
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 MACD(12,26) EMA(9)_MACD Yesterday_OBV Today_OBV
12/16/09 00:00 6.18 6.18 5.99 16330 6.05 -0.00 0.00 0 0
12/17/09 00:00 6.03 6.08 6.00 74300 6.06 0.00 0.00 0 74300
12/18/09 00:00 5.66 5.74 5.14 1677700 5.51 -0.04 -0.01 74300 -1603400
12/21/09 00:00 5.51 5.60 5.45 388200 5.47 -0.08 -0.02 -1603400 -1991600
12/22/09 00:00 5.48 5.72 5.48 336178 5.72 -0.10 -0.04 -1991600 -1655422

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 dialog
* set 'Replace Unit' to 'Chars'
* set 'Replace Scope' to 'Lines'
* enter following in 'Search for pattern' entry:

* enter following in 'Replace with pattern' entry:


click 'Advanced' page, enter following in 'run following for each matched unit' entry:

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

Similar Examples:
How to calculate SUM of EMAs and Covariance of close value from stock data? (66%)
How to calculate Parabolic SAR on a 5 days basis of stock data? (64%)
How to calculate Acc/Dis, OBV and related MA values of stock data? (62%)
How to calculate Williams %R from stock data? (60%)
How to calculate the area of triangles base on 3 sides automatically? (58%)
How to calculate Elder's Force Index (EFI) and related MA, EMA for stock data? (58%)
How to calculate Acc/Dis and corresponding 24 days' MA base on stock data? (58%)
How to calculate CFMO 15 and CFMO 21 from csv file of stock data? (57%)

Check Demo of Text data calculation
Keywords:
calculate obv  how to calculate obv  obv  price  math  specific  toc  stock  script  scrip  replace unit script  calculation on stock data  data base  replace script  calculate text data  if else  replace with data  data replace