Shows current price percentage above or below EMA (default is 250)
//////////////////////////////////////////////////////////// // Copyright by michaelandrewhart, 8/18/15 // Percent difference between price and MA //////////////////////////////////////////////////////////// study(title="Percent difference between price and MA") Length = input(250, minval=1) xEMA = ema(close, Length) nRes = (close - xEMA) * 100 / close plot(nRes, color=blue, title="PD MA") h0 = hline(10) h1 = hline(0) h2 = hline(-10) fill(h0, h1, color=green, transp=80) fill(h1, h2, color=red, transp=80)