I am trying to get buy, and sell signals from the following code:
GraphXSpace=7; n=Optimize("ZIG",9,5,50,1); per=Optimize("rsi",28,5,50,1); Var = Zig(RSI(per), n); //Plot(Var, "", 39); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); //Plot( TEMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); Tma = TEMA( P, Periods); //Plot(Tma, "", colorRed, styleLine);
I can see the output from the above code using _TRACE and verify it using the Plot function.
However, when I add the following code, it doesn't produce any result. I have confirmed using the _TRACE function which shows only '0' as output.
Buy = Cross(Var, Tma) ; Sell = Cross(Tma, Var) ; Short =Cross(Tma, Var) ; Cover = Cross(Var, Tma) ;
Appreciate it if someone can point out errors in my above codes.