Can someone help me by explaining the difference between the 2 different ways of coding an Index Filter (other than the obvious addition of ribbon plotting code)? i.e. will they achieve the same objective of defining the Index filter in terms of its ability to be used backtesting the system?
_SECTION_BEGIN(“Index Filter”);
//=================================================================================================
//Index Filter
//=================================================================================================
IndexTog = ParamToggle(“Index Filter”,”On|Off”,1);
IndexCode = ParamStr(“Index Symbol”,”$XAO.au”);
Index = Foreign(IndexCode,”C”);
IndMA = Param(“Index Filter MA”,200,2,1000,1);
IndexFilterUp = Index > MA(Index,IndMA);
IndexUp = IIf(IndexTog,1,IndexFilterUp);
//=================================================================================================
_SECTION_END();
or the template given to plot the ribbon:
“Foreign Ticker Symbol” ;
ForeignTicker = ParamStr(“Index Symbol”,”$XAO”);
Index = Foreign(ForeignTicker,”C”);
ForeignMA = Param(“Index Filter Length”,70,1,1000,1);
IndexfilterUp = Index > MA(Index,ForeignMA);
RibbonUpColour = ParamColor(“Index Up Colour”,colorGreen);
RibbonDnColour = ParamColor(“Index Down Colour”,colorRed);
RibbonColor = IIf(IndexfilterUp,RibbonUpColour,RibbonDnColour);
Plot ( 1, “”, RibbonColor, styleArea | styleOwnScale | styleNoLabel, -0.0001, 190 );
“”;