Volume Dock
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TommasoRossini

//@version=5
indicator("AD Dock")

lnt = input(11, "Lenght")
mode = input.string("AD Dock", "Mode", ["AD Dock", "RSIs"])
src = math.avg(ta.accdist, ta.obv, ta.accdist)
rsi = ta.rsi(src, lnt)
fastline = ta.hma(rsi, lnt-4)
slowline = ta.hma(ta.rsi(close, lnt), lnt*2)

fastline2 = ta.rsi(src, lnt)
slowline2 = ta.rsi(hlcc4, lnt)

z1 = if mode == "AD Dock"
    fastline
z2 = if mode == "AD Dock"
    slowline
z3 = if mode == "RSIs"
    fastline2
z4 = if mode == "RSIs"
    slowline2

a1 = plot(z1, color = color.gray, linewidth = 2)
a2 = plot(z2, color = color.new(color.gray, 75), linewidth = 1)
fill(a1, a2, color = fastline > slowline ? color.new(#2962ff, 80) : color.new(#e91e63, 80))
a3 = hline(70, linestyle = hline.style_dotted)
a4 = hline(30, linestyle = hline.style_dotted)
a5 = hline(10, color = color.new(color.gray, 100), editable = true)
a6 = hline(90, color = color.new(color.gray, 100), editable = true)
hline(50, "Middle line", color.new(color.gray, 25), linestyle = hline.style_solid)
fill(a3, a6, color = color.new(#e91e63, 85))
fill(a4, a5, color = color.new(#2962ff, 85))
fill(a3, a4, color = color.new(color.gray, 90))
a7 = plot(z3, color = color.gray, linewidth = 2)
a8 = plot(z4, color = color.new(color.gray, 75), linewidth = 1)
fill(a7, a8, color = fastline2 > slowline2 ? color.new(#2962ff, 80) : color.new(#e91e63, 80))