Double Simple Moving Average
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © OmegaTools

//@version=5
indicator("Double Simple Moving Average", overlay = true)

lnt = input(21, "Length")
mult = input(2.00, "Band width")

a = ta.sma(high, lnt)
b = ta.sma(low, lnt)
c = ta.sma(close, lnt)
d = ta.vwma(close, lnt)
sp = a - b

tool = d - c
grad = color.from_gradient(tool, ta.lowest(tool, lnt*3), ta.highest(tool, lnt*3), #e91e63, #2962ff)

p1 = plot(a, "High average", #2962ff)
p2 = plot(b, "Low average", #e91e63)
p3 = plot(c, "Close average", color.gray, 1, display = display.none, editable = false)
fill(p1, p3, color.new(grad, 50))
fill(p2, p3, color.new(grad, 50))

p4 = plot(c + (sp * mult), "High band", color.gray, display = display.none)
p5 = plot(c - (sp * mult), "Low band", color.gray, display = display.none)
fill(p4, p5, color.new(color.gray, 85))