Range Breakout
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © arunbabumvk_23

//@version=4
study(title="Range Breakout", overlay = true)
range_length = input(5, minval=3, title="Range Length")
rangeHighest = highest(high, range_length)
rangeBreakout = iff(close > rangeHighest[1], 1, 0)

rangeSmallest = lowest(low, range_length)
rangeBreakdown = iff(close < rangeSmallest[1], 1, 0)

plotshape(rangeBreakout, style=shape.labelup, location = location.belowbar, color=color.rgb(87,146,100))
plotshape(rangeBreakdown, style=shape.labeldown, location = location.abovebar, color=color.rgb(193,74,80))