))∗ 100;LRS:=LinRegSlope(C,40)/Abs(Ref(C,-39))∗ 100;(HHV(DIVERG,2)>0 AND IM>65 AND IM<Ref(IM,-1) AND Stoch(5,3)>Mov(Stoch(5,3),4,S) AND ROC(SEC2,6,%)>.4 AND ROC(C,1,%)>0){DIVERGENCE}OR (Abs(CI)<35 AND LRS20< .2 AND LLV(Stoch(15,3),4)<30 ANDStoch(15,3)>30 AND Stoch(5,3)>Mov(Stoch(5,3),4,S)) {CONGESTION};A.5 METASTOCK CODE FOR THE FTSE SYSTEM DESCRIBEDIN CHAPTER 14FTSE System(Copyright Markos Katsanos 2008)To recreate the tests, click on enhanced system tester, click on new system and typethe buy, sell, sell short and buy to cover code. Then to run the test, click on new
Appendix A
333
simulation, next, add securities, select the FTSE (.FTSE), select periodicity daily,click on next, select points only test. Click on more. . ., and fill in the commissions0.17 points per transaction (£1.7). Click on trade execution, uncheck realistic market prices and select buy price and sell price at open. Then fill in 1 day for thedelay.You will need also to change the first three lines of the code to point to theappropriate folder in your hard drive where the CAC 40, XOI and BIX data arelocated.LongCAC:=Security(“C:\Metastock Data\REUTERSINDEX\.FCHI”,C);XOI:=Security(“C:\Metastock Data\ REUTERSINDEX \.XOI”,C);BIX:=Security(“C:\Metastock Data\ REUTERSINDEX \.BIX”,C);CI:=ROC(C,39,%)/((HHV(H,40)-LLV(L,40))/(LLV(L,40)+.01)+.000001);CI:=Mov(CI,3,E);RG:=-.11+.551∗ ROC(CAC,10,%)+.097∗ ROC(BIX,10,%)+.116∗ ROC(XOI,10,%);PRED:=Ref(C,-10)∗ (1+RG/100);DIVERG:=(PRED-C)/C∗ 100;IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200) - LLV(DIVERG,200), 3,S));(ALERT(CROSS(50,IM),4) AND ALERT(CROSS(STOCH(10,3),20),3) ANDCROSS(C,MOV(C,5,E)) AND STOCH(10,3)>MOV(STOCH(10,3),4,S))OR(IM>50 AND IM<REF(IM,-1) AND Stoch(5,3)>Mov(Stoch(5,3),4,S) ANDALERT(CROSS(Stoch(10,3),20),3) ANDALERT(L<BBandBot(C,20,S,1),3) AND REF(100∗ LinRegSlope(C,80)/Ref(C,79),-15)>.03)SellCAC:=Security(“C:\Metastock Data\REUTERSINDEX\.FCHI”,C);XOI:=Security(“C:\Metastock Data\ REUTERSINDEX \.XOI”,C);BIX:=Security(“C:\Metastock Data\ REUTERSINDEX \.BIX”,C);RG:=-.11+.551∗ ROC(CAC,10,%)+.097∗ ROC(BIX,10,%)+.116∗ ROC(XOI,10,%);PRED:=Ref(C,-10)∗ (1+RG/100);DIVERG:=(PRED-C)/C∗ 100;IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200) - LLV(DIVERG,200), 3,S));(ALERT(CROSS(IM,30),4) AND ALERT(CROSS(80,STOCH(10,3)),3) ANDALERT(CROSS(MOV(C,10,E),C),2))
334
Intermarket Trading Strategies
ShortCAC:=Security(“C:\Metastock Data\REUTERSINDEX\.FCHI”,C);XOI:=Security(“C:\Metastock Data\ REUTERSINDEX \.XOI”,C);BIX:=Security(“C:\Metastock Data\ REUTERSINDEX \.BIX”,C);RG:=-.11+.551∗ ROC(CAC,10,%)+.097∗ ROC(BIX,10,%)+.116∗ ROC(XOI,10,%);PRED:=Ref(C,-10)∗ (1+RG/100);DIVERG:=(PRED-C)/C∗ 100;IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200) - LLV(DIVERG,200), 3,S));(ALERT(CROSS(IM,30),4) AND ALERT(CROSS(80,STOCH(10,3)),3) ANDALERT(CROSS(MOV(C,10,E),C),2) AND STOCH(10,3)<MOV(STOCH(10,3),4,S))CoverCAC:=Security(“C:\Metastock Data\REUTERSINDEX\.FCHI”,C);XOI:=Security(“C:\Metastock Data\ REUTERSINDEX \.XOI”,C);BIX:=Security(“C:\Metastock Data\ REUTERSINDEX \.BIX”,C);RG:=-.11+.551∗ ROC(CAC,10,%)+.097∗ ROC(BIX,10,%)+.116∗ ROC(XOI,10,%);PRED:=Ref(C,-10)∗ (1+RG/100);DIVERG:=(PRED-C)/C∗ 100;IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200) - LLV(DIVERG,200), 3,S));ALERT(CROSS(50,IM),4) AND STOCH(10,3)>MOV(STOCH(10,3),4,E) ANDC>MOV(C,10,E)NoteAs I have stressed in the book, the correlation between related markets is not staticbut changes over time.Although the regression coefficients used in the current FTSE multiple regressionsystem above were the best at the time of writing (December 2007), by the time thisbook is published, correlations might have changed and the regression coefficientsmight need adjustment.Therefore, if you wish to use the multiple regression system you should firstcheck the correlations between the FTSE and the independent variables used in theregression equation (CAC 40, BIX and XOI) and if any of the correlations havechanged (from the ones depicted in Table 14.1), you will have to make the necessaryadjustments in the regression coefficients.
Appendix A
335
A.6 METASTOCK CODE FOR THE OIL AND GOLD STOCK SYSTEMSDESCRIBED IN CHAPTER 15Oil StocksMetaStock exploration codeTo create the Oil Stock exploration, go to The Explorer and choose the New button.Enter in the following code in the filter column. To explore for possible hits, open theExplorer (click on binocular icon), click on Options and load 900 records, then clickexplore and select the folder in your hard drive with oil stocks. Be sure to changethe first three lines of the code to point to the appropriate folders on your hard drivewhere the crude oil, S&P 500 and XOI data are located.SEC1:=Security(“C:\Metastock Data\REUTERSFUTURES\@:CLc1”,C);SEC2:=Security(“C:\Metastock Data\REUTERSINDEX\.SPX”,C);SEC3:=Security(“C:\Metastock Data\REUTERSINDEX\.XOI”,C);VFI:=Fml(“VFI”);RS:=Mov((C/SEC3),3,E);sY:=Stdev(C,300)/Mov(C,300,S);s1:=Stdev(SEC1,300))/Mov(SEC1,300,S);s2:=Stdev(SEC2,300))/Mov(SEC2,300,S);rY1:=Correl(ROC(SEC1,10,%),ROC(C,10,%),300,0);rY2:=Correl(ROC(SEC2,10,%),ROC(C,10,%),300,0);r12:=Correl(ROC(SEC1,10,%),ROC(SEC2,10,%),300,0);rY12:=(rY1-rY2∗ r12)/Sqrt(1-r12∗ r12);rY21:=(rY2-rY1∗ r12)/Sqrt(1-r12∗ r12);LRS1:=LinRegSlope(SEC1,25)/Abs(Ref(SEC1,-24))∗ 100;LRS2:=LinRegSlope(SEC2,25)/Abs(Ref(SEC2,-24))∗ 100;LRS:=LinRegSlope(C,20)/Abs(Ref(C,-19))∗ 100;DIVERG:=(rY12∗ sY/s1∗ LRS1+rY21∗ sY/s2∗ LRS2-LRS)∗ 100;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));Mov(RS,50,S)>Mov(RS,200,S) AND Mov(VFI,50,S)>Mov(VFI,200,S) ANDDIVERG>0 AND Alert(Cross(70,IM),5) AND Stoch(5,3)>Mov(Stoch(5,3),4,S)AND Correl(SEC3,C,200,0)>0.5If you don’t have the VFI and FVE custom (money flow) indicators you must firstcreate them because they are being called by the oil exploration system.
336
Intermarket Trading Strategies
To create the VFI Indicator in MetaStock, click on the indicator builder (fx), clickon New. . ., type VFI in the Name box and the following code in the formula box.Use the same procedure to create the FVE indicator.VFI formulaPERIOD:= Input(“PERIOD FOR VFI”,5,1300,130);COEF:=.2;VCOEF:=Input(“MAX VOLUME CUTOFF”,0,50,2.5);INTER:=Log(Typical())-Log(Ref(Typical(),-1));VINTER:=Stdev(INTER,30);CUTOFF:=COEF∗ VINTER∗ C;VAVE:=Ref(Mov(V,PERIOD,S),-1);VMAX:=VAVE∗ VCOEF;VC:=If(V<VMAX,V,VMAX);MF:=Typical()-Ref(Typical(),-1);VFI:=Sum(If(MF>CUTOFF, +VC, If(MF <-CUTOFF, -VC,0)),PERIOD)/VAVE;Mov(VFI,3,E);FVE formulaPERIOD:= Input(“PERIOD FOR FVE”,5,80,22);COEF:=Input(“COEF FOR CUTOFF”,0,2,.1);H1:=If(H>0,H,Mov(H,5,S));L1:=If(L>0,L,Mov(L,5,S));INTRA:=Log(H1)-Log(L1);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF∗ (VINTER+VINTRA)∗ C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);FVE:= Sum(If(MF>CUTOFF, +V, If(MF <-CUTOFF, -V,0)),PERIOD)/(Mov(V,PERIOD,S)+1)/PERIOD∗ 100;FVEMetaStock Expert AdvisorOil stock systemMetaStock explorations only provide entry signals. To get exit signals you shouldcreate another expert advisor and attach it to the oil stocks that you bought.To create the oil stock (bullish) expert advisor click on the binocular icon thenclick on new. . . , and fill in an appropriate name (e.g. oil stocks) in the name fieldand fill in the following in the Notes field: Oil stock system (see Chapter 15 ofIntermarket Trading Strategies by Markos Katsanos). Then click on symbols, then
Appendix A
337
fill in the appropriate action (BUY) and fill in the same code that you used for theoil stock exploration above. Then click on Graphic and select an appropriate graphic(e.g. green arrow below price plot).Then click again on the new symbol, name it EXIT and fill in the following code:SEC1:=Security(“C:\Metastock Data\REUTERSFUTURES\@:CLc1”,C);SEC2:=Security(“C:\Metastock Data\REUTERSINDEX\.SPX”,C);sY:=Stdev(C,300)/Mov(C,300,S);s1:=Stdev(SEC1,300))/Mov(SEC1,300,S);s2:=Stdev(SEC2,300)/Mov(SEC2,300,S);rY1:=Correl(ROC(SEC1,10,%),ROC(C,10,%),300,0);rY2:=Correl(ROC(SEC2,10,%),ROC(C,10,%),300,0);r12:=Correl(ROC(SEC1,10,%),ROC(SEC2,10,%),300,0);rY12:=(rY1-rY2∗ r12)/Sqrt(1-r12∗ r12);rY21:=(rY2-rY1∗ r12)/Sqrt(1-r12∗ r12);LRS1:=LinRegSlope(SEC1,25)/Abs(Ref(SEC1,-24))∗ 100;LRS2:=LinRegSlope(SEC2,25)/Abs(Ref(SEC2,-24))∗ 100;LRS:=LinRegSlope(C,20)/Abs(Ref(C,-19))∗ 100;DIVERG:=(rY12∗ sY/s1∗ LRS1+rY21∗ sY/s2∗ LRS2-LRS)∗ 100;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));(Stoch(15,3)<Mov(Stoch(15,3),5,S) AND HHV(Stoch(15,3),3)>80 ANDLLV(IM,4)<7)Don’t forget to change the first two lines of the code to point to the folder in yourhard drive where data for crude oil futures and the S&P 500 are located. Then clickon Graphic and select an appropriate graphic (e.g. red EXIT sign above the priceplot). All you have to do now is attach this expert to the stocks that you bought usingthe oil exploration.MetaStock Code for Tradesim SimulationOil stocksThis test can only be run with Tradesim v. 4.2 2 (a MetaStock plug-in) which can beobtained from http://www.compuvision.com.au/.After running the MetaStock exploration open Tradesim and load the OIL STOCKSfile and fill in the following trade parameters:Initial trading capital: $100 000Maximum open positions: 20Transaction cost: $10Minimum trade size: $3000
338
Intermarket Trading Strategies
Volume filter: Limit position to a maximum of 15 % of the traded volume.Check the Pyramid profits and Equal percent dollar units boxes and fill in thefollowing 10 % for the percentage.The code for the Tradesim test is the same code used for the MetaStock explorationplus the additional Tradesim commands (beginning with ENTRYTRIGGER) whichshould be added at the end. The complete code should be copied in column A of theexplorer.SEC1:=Security(“C:\Metastock Data\REUTERSFUTURES\@:CLc1”,C);SEC2:=Security(“C:\Metastock Data\REUTERSINDEX\.SPX”,C);SEC3:=Security(“C:\Metastock Data\REUTERSINDEX\.XOI”,C);VFI:=Fml(“VFI”);RS:=Mov((C/SEC3),3,E);sY:=Stdev(C,300)/Mov(C,300,S);s1:=Stdev(SEC1,300))/Mov(SEC1,300,S);s2:=Stdev(SEC2,300))/Mov(SEC2,300,S);rY1:=Correl(ROC(SEC1,10,%),ROC(C,10,%),300,0);rY2:=Correl(ROC(SEC2,10,%),ROC(C,10,%),300,0);r12:=Correl(ROC(SEC1,10,%),ROC(SEC2,10,%),300,0);rY12:=(rY1-rY2∗ r12)/Sqrt(1-r12∗ r12);rY21:=(rY2-rY1∗ r12)/Sqrt(1-r12∗ r12);LRS1:=LinRegSlope(SEC1,25)/Abs(Ref(SEC1,-24))∗ 100;LRS2:=LinRegSlope(SEC2,25)/Abs(Ref(SEC2,-24))∗ 100;LRS:=LinRegSlope(C,20)/Abs(Ref(C,-19))∗ 100;DIVERG:=(rY12∗ sY/s1∗ LRS1+rY21∗ sY/s2∗ LRS2-LRS)∗ 100;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));ENTRYTRIGGER:=Mov(RS,50,S)>Mov(RS,200,S) AND Mov(VFI,50,S)>Mov(VFI,200,S) ANDDIVERG>0 AND Alert(Cross(70,IM),5) AND Stoch(5,3)>Mov(Stoch(5,3),4,S)AND Correl(SEC3,C,200,0)>0.5;EXITTRIGGER:=(Stoch(15,3)<Mov(Stoch(15,3),5,S) AND HHV(Stoch(15,3),3)>80AND LLV(IM,4)<7)(Alert(Cross(0,Fml(“FVE”)),7) AND Fml(“FVE”)<-5 ANDCross(Mov(VFI,100,E),VFI));ExtFml(“TradeSim.Initialize”);ExtFml(“TradeSim.SetVolumeMultiplier”,100);
Appendix A
339
ExtFml(“TradeSim.SetTimeStop”,100);ExtFml(“TradeSim.EnableDelayOfEntryByOneBar”);ExtFml(“TradeSim.EnableDelayOfAllExitsByOneBar”);ExtFml(“TradeSim.RecordTrades”,“OIL STOCKS”,LONG,EntryTrigger,OPEN,0, EXITTRIGGER,OPEN,START);Gold StocksMetaStock code for Tradesim simulationSEC1:=Security(“C:\Metastock Data\METAS\XGLD”,C);SEC3:=Security(“C:\Metastock Data\METAS\XAU”,C);VFI:=Fml(“VFI”);RS:=Mov((C/SEC3),3,E);D1:=500; {REGRESSION DAYS}D2:=11; {ROC DAYS}RS1:=ROC(C,D2,%);RS2:=ROC(SEC1,D2,%);b:=Correl(RS1,RS2,D1,0)∗ Stdev(RS1,D1)/Stdev(RS2,D1);a:=Mov(RS1,D1,S)-b∗ Mov(RS2,D1,S);pred:=b∗ RS2+a;DIVERG:=(PRED-RS)∗ 10;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));ENTRYTRIGGER:= Mov(RS,50,S)>Mov(RS,200,S) AND Mov(VFI,50,S)>Mov(VFI,200,S) ANDDIVERG>0 AND Alert(Cross(70,IM),5) AND Stoch(5,3)>Mov(Stoch(5,3),4,S)AND Correl(ROC(SEC1,10,%),ROC(C,10,%),200,0)>0.1;EXITTRIGGER:=(Stoch(15,3)<Mov(Stoch(15,3),5,S) AND HHV(Stoch(15,3),3)>80 AND LLV(IM,4)<7)ExtFml(“TradeSim.Initialize”);ExtFml(“TradeSim.SetVolumeMultiplier”,100);ExtFml(“TradeSim.SetTimeStop”,80);ExtFml(“TradeSim.EnableDelayOfEntryByOneBar”);ExtFml(“TradeSim.EnableDelayOfAllExitsByOneBar”);ExtFml(“TradeSim.RecordTrades”,“GOLD STOCKS”,LONG,EntryTrigger,OPEN,0, EXITTRIGGER,OPEN,START);MetaStock exploration codeTo create the Gold Stock exploration, go to The Explorer and choose the New button.Enter in the following code in the filter column. To explore for possible hits, open theExplorer (click on binocular icon), click on Options and load 900 records, then click
340
Intermarket Trading Strategies
explore and select the folder in your hard drive with gold stocks. Be sure to changethe first two lines of the code to point to the appropriate folders on your hard drivewhere gold bullion or GLD, and XAU data are located.SEC1:=Security(“C:\Metastock Data\METAS\XGLD”,C);SEC3:=Security(“C:\Metastock Data\METAS\XAU”,C);VFI:=Fml(“VFI”);RS:=Mov((C/SEC3),3,E);D1:=500; {REGRESSION DAYS}D2:=11; {ROC DAYS}RS1:=ROC(C,D2,%);RS2:=ROC(SEC1,D2,%);b:=Correl(RS1,RS2,D1,0)∗ Stdev(RS1,D1)/Stdev(RS2,D1);a:=Mov(RS1,D1,S)-b∗ Mov(RS2,D1,S);pred:=b∗ RS2+a;DIVERG:=(PRED-RS)∗ 10;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));Mov(RS,50,S)>Mov(RS,200,S) AND Mov(VFI,50,S)>Mov(VFI,200,S) ANDDIVERG>0 AND Alert(Cross(70,IM),5) AND Stoch(5,3)>Mov(Stoch(5,3),4,S)AND Correl(ROC(SEC1,10,%),ROC(C,10,%),200,0)>0.1
MetaStock Expert AdvisorGold stock systemMetaStock explorations only provide entry signals. To get both entry and exit signalsyou should create an expert advisor and attach it to the gold stocks that you bought.To create the gold stock expert advisor click on the appropriate icon then clickon new.., and fill in a suitable name (e.g. Gold stocks) in the name field and fill inthe following in the Notes field: Gold stock system (see Chapter 15 of IntermarketTrading Strategies by Markos Katsanos). Then click on symbols, then fill in theappropriate action (BUY) and fill in the same code that you used for the explorationabove. Then click on Graphic and select an appropriate graphic (e.g. green arrowbelow price plot).Then click again on new symbol, name it EXIT and fill in the following code :SEC1:=Security(“C:\Metastock Data\METAS\XGLD”,C);SEC3:=Security(“C:\Metastock Data\METAS\XAU”,C);VFI:=Fml(“VFI”);RS:=Mov((C/SEC3),3,E);
Appendix A
341
D1:=500; {REGRESSION DAYS}D2:=11; {ROC DAYS}RS1:=ROC(C,D2,%);RS2:=ROC(SEC1,D2,%);b:=Correl(RS1,RS2,D1,0)∗ Stdev(RS1,D1)/Stdev(RS2,D1);a:=Mov(RS1,D1,S)-b∗ Mov(RS2,D1,S);pred:=b∗ RS2+a;DIVERG:=(PRED-RS)∗ 10;DIVERG:=Mov(DIVERG,3,E);IM:=(Mov(DIVERG - LLV(DIVERG,200), 3,S) ∗ 100)/(Mov(HHV(DIVERG,200)-LLV(DIVERG,200),3,S));(Stoch(15,3)<Mov(Stoch(15,3),5,S) AND HHV(Stoch(15,3),3)>80 AND LLV(IM,4)<7)Don’t forget to change the first two lines of the code to point to the folder in yourhard drive where data for gold spot prices (or the World Gold Index) and the XAUare located. Then click on Graphic and select an appropriate graphic (e.g. red EXITsign above the price plot). All you have to do now is attach this expert to the stocksthat you bought using the gold exploration.A.7 METASTOCK CODE FOR THE FUTURES AND ETF SYSTEMSIN CHAPTER 161 Test II Relative Strength System (FUTURES)MetaStock code for Tradesim simulationThis test can only be run with Tradesim v. 4.2 2 (a MetaStock plug-in) which can beobtained from http://www.compuvision.com.au/.To run this test you should change the first line of the code to point to the appropriatefolder on your hard drive where the S&P 500 data are located. Copy and paste thefollowing code into column A of MetaStock’s explorer and then click on options andload 2100 records.After running the MetaStock exploration, open Tradesim and load the FUTURESfile and fill in the following trade parameters:Initial trading capital: $500 000Maximum open positions: 30Capital per trade: $30 000Transaction cost: $10Minimum trade size: $5000Ignore volume filter
342
Intermarket Trading Strategies
SEC2:=Security(“C:\Metastock Data\REUTERSINDEX\.SPX”,C);D3:=150;{DAYS FOR SMOOTH RS}RS:=Mov((C/SEC2),D3,E);entrytrigger:= RS>Mov(RS,120,E) AND ROC(Mov(C,25,E),2,%)>0 ANDLinRegSlope(RS,20)>0AND Correl(C,SEC2,130,0)<.5 AND Stoch(100,3)<80AND RS>Ref(HHV(RS,250),-20);EXITTRIGGER:=Cross(Mov(RS,90,E),RS) OR ROC(RS,3,%)<-.5;ExtFml(“TradeSim.Initialize”);ExtFml(“TradeSim.EnableDelayOfEntryByOneBar”);ExtFml(“TradeSim.EnableDelayOfAllExitsByOneBar”);ExtFml(“TradeSim.RecordTrades”,“FUTURES”,LONG,EntryTrigger,OPEN,0,EXITTRIGGER,OPEN,START);
MetaStock Exploration Code for the Relative Strength FUTURES SystemTo create the FUTURES exploration, go to The Explorer and choose the New button.Enter in the following code in the appropriate column. To explore for possible hits,open the Explorer (click on binocular icon), click on Options and load 500 records,then click explore and select the folders in your hard drive with Commodity, IndexFUTURES and International Indices. Be sure to change the first line of the codeto point to the appropriate folder on your hard drive where the S&P 500 data arelocated.Column A:Col. Name: PriceCode: CColumn B:Col. Name: RSCode:SEC2:=Security(“C:\Metastock Data\REUTERSINDEX\.SPX”,C);D3:=150;{DAYS FOR SMOOTH RS}RS:=Mov((C/SEC2),D3,E);RSColumn C:Col. Name: HHV RSCode:SEC2:=Security(“C:\Metastock