After modifying the code (as given below), the error is gone.
//------------ 2
Buy2 = C>xx AND C>trailarray;
Sell2 = C<xx AND C<trailarray;
buy2=ExRem(buy2,sell2);
sell2=ExRem(sell2,buy2);
Buy=Cover=Buy2;
Sell=Short=Sell2;
PlotShapes(Buy2*shapeUpArrow+Sell2*shapeDownArrow, IIf(Buy2,colorGreen,colorRed),0,IIf(Buy2,L-30,H+30)) ;
I backtested it for this week on Banknifty and getting only 2 trades in the result. But actually there has been around 13 trades as shown in the chart. Not sure why? Need your help on this please.
//------------ 2
Buy2 = C>xx AND C>trailarray;
Sell2 = C<xx AND C<trailarray;
buy2=ExRem(buy2,sell2);
sell2=ExRem(sell2,buy2);
Buy=Cover=Buy2;
Sell=Short=Sell2;
PlotShapes(Buy2*shapeUpArrow+Sell2*shapeDownArrow, IIf(Buy2,colorGreen,colorRed),0,IIf(Buy2,L-30,H+30)) ;
I backtested it for this week on Banknifty and getting only 2 trades in the result. But actually there has been around 13 trades as shown in the chart. Not sure why? Need your help on this please.
* to avoid confusion use this
PlotShapes(Buy*shapeUpArrow+Sell*shapeDownArrow, IIf(Buy,colorGreen,colorRed),0,IIf(Buy,L-10,H+10)) ;