I am trying to test a small change to the index filter discussed in the course. It is just if the Close of the index is above the MA(100) or MA(30) to try to remove a bit of the lag that a longer term MA can have. It should be simple i thought but i am just getting a true reading all the time even when the conditions aren’t met.
Code:
IndexTog = ParamToggle(“Index Filter”,”On|Off”,0);
IndexCode = ParamStr(“Index Symbol”,”$XAO.asx”);
Index = Foreign(IndexCode,”C”);
IndexMA = Param(“Index MA”,100,20,200,5);
IndexMA2 = Param(“Index MA 2”,30,20,200,5);
IndFiltUp = Index > (MA(Index,IndexMA) OR MA(Index,IndexMA2));
IndexUp = IIf(IndexTog,1,IndFiltUp);
Am i missing something simple here?