Whenever there is a breakout candle I want to store the low of the bar as the stop. Then whenever price reach below the value, I want it to create an arrow and reset the array, until condition is met again (IE when stopped out it should not show more until new breakout). Otherwise It will keep to print arrows. But I cant make it work.
//@version=5
indicator("TB", overlay = true)
var float stop_breakout = na
narrow = (width[0] < width[1]) and (width[0] < width[2]) and (width[0] < width[3])
breakout = narrow[1] and (close[0] > (high[1])
if (breakout == true)
stop_breakout := low
if (close < stop_breakout)
stop_breakout := na
plotshape(close < stop_breakout, style = shape.triangledown, location = location.abovebar, size=size.auto, color=color.red)