Deviations from ARL (DARL)
// 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("Deviations from ARL", "DARL", overlay = true, timeframe = "", timeframe_gaps = true)

V_Offset = input.float(0, "V Offset", step = 0.1)
Inner_Deviation = input.float(1.5, "Inner", step = 0.1)
Outer_Deviation = input.float(3.0, "Outer", step = 0.1)
Length = input(70, "Length")

ARL = (ta.ema(low, 14)[1] + (hlc3 - ta.ema(low, 14)[1]) / (14 * math.pow(hlc3 / ta.ema(close, 14)[1], 0))) * (1.00 + (V_Offset * 0.01))
Deviation_Base = ta.stdev(ARL, Length)

T_Line = ARL + (Deviation_Base * Outer_Deviation)
H_Line = ARL + (Deviation_Base * Inner_Deviation)
L_Line = ARL - (Deviation_Base * Inner_Deviation)
B_Line = ARL - (Deviation_Base * Outer_Deviation)

plot(T_Line, "Top"   , color.rgb(103,  58, 183))
plot(H_Line, "High"  , color.rgb(186, 104, 200))
plot(ARL   , "Middle", color.rgb( 91, 156, 246))
plot(L_Line, "Low"   , color.rgb(186, 104, 200))
plot(B_Line, "Bottom", color.rgb(103,  58, 183))
