Appendix A
MetaStock Code and Test Specifications

A.1 METASTOCK CODE FOR THE INDICATORS DESCRIBED IN CHAPTER 9

(Copyright Markos Katsanos 2008)
 
Intermarket Relative Strength Indicator
 
To create this indicator click on the indicator builder f(x), click on new and then copy the following code in the formula box.
You will also need to change the first line of the code to point to the appropriate folder in your hard drive where data for the dollar index are located.
SEC2:=Security(“C:\Metastock Data\INTERMARKET\DXY0”,C); D1:=Input(“MA DAYS”,1,300,3); RS:=Mov((C/SEC2),3,E); RS
Intermarket Bollinger Band Divergence
 
The indicator should be applied on the plot of the related intermarket security.
D1:=Input(“PERIOD FOR BB”,5,1000,40); D2:=Input(“PERIOD FOR BB INTERMARKET ”,5,1000,40); sec1BOL:=1+((C- Mov(C,D1,S)+2*Stdev(C,D1))/(4*Stdev(C,D1))); sec2BOL:=1+(INDICATOR- Mov(INDICATOR,D2,S)+2*Stdev(INDICATOR, D2))/(4*Stdev(INDICATOR,D2)); DIVERG1:=(sec2BOL-sec1BOL)/SEC1BOL*100; diverg:=Mov(diverg1,3,E);DIVERG
 
Intermarket Disparity
 
You will also need to change the first line of the code to point to the appropriate folder in your hard drive where data for the dollar index are located.
SEC2:=Security(“C:\Metastock Data\METAS\DXY0”,C); D1:=Input(“MA PERIOD BASE SECURITY”,5,200,30); D2:=Input(“MA PERIOD INTERMARKET SECURITY”,5,200,30); D3:=Input(“ FOR +VE CORRELATION +1, FOR -VE -1”,-1,1,-1); DIS1:=((C – Mov(C,D1,S))/Mov(C,D1,S))* 100; DIS2:=((SEC2 – Mov(SEC2,D2,S))/Mov(SEC2,D2,S)) * 100; ...

Get Intermarket Trading Strategies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.