Distance from Avg + avgs
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ta96ninja

//@version=4
study("Distance from Avg + avgs", overlay=false)
len = input(200)
smaC = sma(close,len)
smaH = sma(high,len)
smaL = sma(low,len)
smaO = sma(open,len)




o = (((open/smaC)-1)*100)
h = (((high/smaC)-1)*100)
l = (((low/smaC)-1)*100)
c = (((close/smaC)-1)*100)

plotbar(o,h,l,c)
plot(c)
plot(c)



len1 = input(200)
smalen1 = sma((((close/smaC)-1)*100),len1)
plot(smalen1, color=color.red)
len2 = input(50)
smalen2 = sma((((close/smaC)-1)*100),len2)
plot(smalen2, color=color.aqua)
len3 = input(8)
emalen3 = sma((((close/smaC)-1)*100),len3)
plot(emalen3, color=color.black)
band1 = hline(0,title = "zero line", color=color.black)











