Range ( Adjustable ) HLLS
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Cryptoir
// Adjustable Range of Previos candles

//@version=5
indicator("Range ( Adjustable )" , overlay=true)


NumberOfBars = input.int(400, title=" last Candles For Range ")
Heightscale = input.int(10 , title = "Adjust Totall Height ")
offset = input.int(0 , title= "Offset")
BarRange = high - low
emaAvg = ta.ema(close , 200)
avgRange = ta.ema(BarRange , NumberOfBars)
AvgUnder = avgRange * Heightscale + emaAvg
AvgAbove = emaAvg - avgRange * Heightscale 

// Lines
plot(AvgAbove, color=color.rgb(255, 59, 59), offset = offset , title="bars") 
plot(AvgUnder, color=color.rgb(0, 212, 53), offset = offset , title="bars") 

