How to check the next bar after the Buy / Sell Signal

If buy signal check for next bar and if the next bar after the signal bar, "high" is greater than the signal bar "High" bar plot an arrow and the Price of "High" next bar after the Signal bar.

"only the immediate bar next to signal bar"

bar_after_buy=Ref(Buy,-1);
PlotShapes(IIf(bar_after_buy,shapeUpArrow,shapeNone),colorYellow,0,H,-12);

AtB

@twin maybe something like this

Buy = Cross( MACD(), Signal() );
Sell = Cross( Signal(), MACD() );

bar_after_buy = Ref( Buy, -1 ) AND H > ValueWhen( Buy, H, 1 );

PlotOHLC( O, H, L, C, "", colorDefault, styleCandle );

PlotShapes( IIf( buy, shapeStar, shapeNone ), colorYellow, 0, L, -12 );

PlotShapes( IIf( bar_after_buy, shapeUpArrow, shapeNone ), colorYellow, 0, L, -12 );

image

3 Likes

@portfoliobuilder Thank you :slight_smile: