Adaptive Rebound Line (ARL)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © More-Than-Enough

//@version=5
indicator(title = "Adaptive Rebound Line", shorttitle = "ARL", overlay = true, precision = 3, timeframe = "", timeframe_gaps = true)

Length = input(14, "Length")
Exponent = input.int(0, "Exponent", step = 10)
Primary_Source = input(hlc3, "Primary Source")
Secondary_Source = input(low, "Secondary Source")
Deviation = input.float(0.0, "Deviation", step = 0.1)

ARL = (ta.ema(Secondary_Source, Length)[1] + (Primary_Source - ta.ema(Secondary_Source, Length)[1]) / (Length * math.pow(Primary_Source / ta.ema(close, Length)[1], Exponent))) * (1.00 + (Deviation * 0.01))
plot(ARL, title = "ARL", color = color.rgb(91, 156, 246), linewidth = 2)