Bitcoin Weekly Support Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Ryukobushi

//@version=4

study(title="Bitcoin Weekly Support Bands", overlay=true, resolution="W")

src = input(close, title="Source")

len0 = input(8, minval=1, title="8sma")
out0 = sma(src, len0)
len1 = input(6, minval=1, title="6ema")
out1 = ema(src, len1)
len2 = input(20, minval=1, title="20sma")
out2 = sma(src, len2)
len3 = input(16, minval=1, title="16ema")
out3 = ema(src, len3)
len4 = input(64, minval=1, title="64ema")
out4 = ema(src, len4)
len5 = input(94, minval=1, title="94ema")
out5 = ema(src, len5)
len6 = input(140, minval=1, title="140sma")
out6 = sma(src, len6)
len7 = input(150, minval=1, title="150ema")
out7 = ema(src, len7)
len8 = input(265, minval=1, title="265sma")
out8 = sma(src, len8)
len9 = input(300, minval=1, title="300ema")
out9 = ema(src, len9)
len10 = input(56, minval=1, title="56sma")
out10 = sma(src, len10)
len11 = input(93, minval=1, title="93sma")
out11 = sma(src, len11)

o0 = plot(out0, linewidth=1, color=color.blue, title="8sma")
o1 = plot(out1, linewidth=3, color=color.fuchsia, title="6ema")
o2 = plot(out2, linewidth=1, color=color.red, title="20sma")
o3 = plot(out3, linewidth=3, color=color.green, title="16ema")
o4 = plot(out4, linewidth=1, color=color.red, title="64ema")
o5 = plot(out5, linewidth=3, color=color.green, title="94ema")
o6 = plot(out6, linewidth=1, color=color.red, title="140sma")
o7 = plot(out7, linewidth=3, color=color.green, title="150ema")
o8 = plot(out8, linewidth=1, color=color.red, title="265sma")
o9 = plot(out9, linewidth=3, color=color.green, title="300ema")
o10 = plot(out10, linewidth=3, color=color.yellow, title="56sma")
o11 = plot(out11, linewidth=3, color=color.yellow, title="93sma")

fill(o0, o1, color=color.yellow)
fill(o2, o3, color=color.yellow)
fill(o4, o5, color=color.yellow)
fill(o6, o7, color=color.yellow)
fill(o8, o9, color=color.yellow)
