The importable AIQ EDS file based on Vitali Apirine’s article in the April Stocks & Commodities issue, “On-Balance Volume Modified,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also available below.
I coded the indicator described by the author and also coded a simple buy-sell on crossovers of the indicator. I tested the long side in the AIQ EDS module. Figure 5 shows the backtest results over the last 10 years using the Nasdaq 100 list of stocks.
FIGURE 5: AIQ. Sample backtest results are shown for the last 10 years using the Nasdaq 100 list of stocks.
!ON-BALANCE VOUUME MODIFIED (OBVM)
!Author: Vitali Apirine, TASC Apr 2020 !Coded by: Richard Denning 2/9/20 !www.TradersEdgeSystems.com
!ON BALANCE VOLUME:
C is [close].
C1 is val([close],1).
!OBV THAT HAS SAME SHAPE AS BUILT-IN OBV INDICATOR
DaySum is hasdatafor(2000).
F is iff(C > C1,1,iff(C < C1,-1,0)).
VolSum1 is Sum([volume] / 1000 * F, DaySum).
VolSum2 is 1000 + VolSum1.
OBVv1 is iff(FirstDataDate() >= Reportdate(),1000,VolSum2).
!ON BALANCE VOLUME MODIFIED:
!Hard coded version:
len1 is 7. len2 is 10.
VVV is expavg(OBVv1,len1).
SigVVV is expavg(VVV,len2).
!ON BALANCE VOULUME MODIFIED (***preferred version***):
!Using built-in OBV indicator (runs much faster)
pd1 is 7.
pd2 is 10.
OBVM is expavg([OBV],pd1).
sigOBVM is expavg(OBVM,pd2).
for AIQ Systems