MP + India
Posts: 1 since Aug 2018
Thanks Given: 0
Thanks Received: 0
|
Below is my code:
st = SuperTrend(10,3);
_x = TimeFrameGetPrice("H", inDaily, -1);
_y = (_x * 1.009);
_z = TimeFrameGetPrice("H", inDaily );
cond1 = Cross(C, st);
cond2 = _z > _y;
Buy = cond1 AND cond2;
Sell = Cross(st, C) ;
Plot(_y, "PDaysH", colorGold,styleDashed,0,0,0,0,0);
Plot(_z, "PDaysH", colorOrange,styleDashed,0,0,0,0,0);
Plot(st, "STOP", IIf(C>st,colorBrightGreen,colorRed),styleLine|styleStaircase|styleThick); //ploting highlow
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone), colorGreen, 0,L, offset=-120);
Problem I am facing is if cond2 gets satisfied in future, signal gets generated on previous signal candle (at right place) can anyone guide on how to ignore that. I want signal should be generated only if its a latest candle and both conds are true. In the attached file you can see that cond2 turns true after 3 candles from cond1 and buy signal turns true at the place of cond1 == true.
|