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

//@version=5
indicator("Support Bands",overlay=true)

ema8= ta.ema(close,8)
sma10= ta.sma(close,10)

ema8_c=plot (ema8, "EMA8",color=color.rgb(89, 238, 109))
sma10_c=plot (sma10, "SMA 10",color=color.rgb(91, 158, 221))

MA8Index= ema8
MA10Index=sma10

plotshape(ta.crossover(MA8Index,MA10Index), style=shape.arrowup,  color=color.green)
plotshape(ta.crossover(MA10Index,MA8Index), style=shape.arrowdown, color=color.rgb(190, 10, 10))


fill(ema8_c,sma10_c, title="Support Band 1",color = ema8 > sma10? color.new(color.green,50): ema8 < sma10 ? color.new(color.red,50):na)

ema21= ta.ema(close,21)
sma30= ta.sma(close,30)


ema21_c=plot(ema21,"EMA 21",color=color.orange)
sma30_c=plot(sma30,"SMA 30",color=color.rgb(70, 61, 61))

MA21Index= ema21
MA30Index=sma30

plotshape(ta.crossover(MA21Index,MA30Index), style=shape.arrowup, color=color.rgb(107, 188, 241))
plotshape(ta.crossover(MA30Index,MA21Index), style=shape.arrowdown, color=color.rgb(250, 169, 76))

fill(ema21_c,sma30_c, title="Support Band 2", color = ema21 > sma30? color.new(color.green,50): ema21 < sma30 ? color.new(color.red,50):na)


a=ta.sma(close,5)
j=ta.sma(close,195)
c=ta.sma(close,130)
h=ta.sma(close,65)
i=ta.sma(close,30)

b=ta.sma(close,40)

src1 = input(close, "SMA Source")
len1 = input(50, "SMA")
out1 =ta.sma(src1, len1)
plot(out1, title="SMA 50", color=close >= out1 ? color.rgb(31, 167, 14, 42) : color.rgb(155, 32, 32))

d=ta.sma(close,100)
e=ta.sma(close,150)
f=ta.sma(close,200)
g=ta.sma(close,300)

plot(a, "B Shannon 5 SMA",color=color.rgb(212, 141, 208))
plot(j,"10 Min 5 SMA", color= color.rgb(212, 141, 208))
plot(c,"15 Min 5 SMA", color= color.rgb(212, 141, 208))
plot(h,"30 Min 5 SMA", color= color.rgb(212, 141, 208))
plot(i,"65 Min 5 SMA", color= color.rgb(212, 141, 208))


plot(b, "SMA 40", color=color.rgb(97,97,97))
plot(d,"SMA 100",color=color.rgb(252, 251, 251))
plot(e, "SMA 150",color=color.rgb(243, 33, 233))
plot(f,"SMA 200",color=color.yellow)
plot(g,"SMA 300",color=color.rgb (112,2,2))

