double Bollinger Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © alixnet

//@version=5
indicator(shorttitle="2BB", title="double Bollinger Bands", overlay=true, timeframe="", timeframe_gaps=true)
length = input.int(20, minval=1)
src = input(close, title="Source")
mult = input.float(1.0, minval=0.001, maxval=50, title="StdDev 1")
mult2 = input.float(2.0, minval=0.001, maxval=50, title="StdDev 2")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
dev2 = mult2 * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
upper2 = basis + dev2
lower2 = basis - dev2
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(basis, "Basis", color=#FF6D00, offset = offset)
p1 = plot(upper, "Upper", color=#2962FF, offset = offset)
p2 = plot(lower, "Lower", color=#2962FF, offset = offset)
p3 = plot(upper2, "Upper", color=#2453d4, offset = offset)
p4 = plot(lower2, "Lower", color=#2453d4, offset = offset)
fill(p1, p3,  title = "Background", color=color.rgb(33, 150, 243, 85))
fill(p2, p4,  title = "Background", color=color.rgb(33, 150, 243, 85))
