MarcoValente

ema-sma

1637
oscillator from the difference between Ema and Sma, moving around 0 line, Quite reactive if use the cross of the 2 lines , more conservative if wait the lines cross the zero line. I add columns for the big change of volume with the cut off so it s show only big divergence with the avarage. colors show trends. I think usefull
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//
study(title="ema-sma", shorttitle="ema-sma + vol")
src =input(close,title="source"),length = input(9, minval=1,title="short ema"),lensma=input(17,title="long sma")
vol=volume
vm=100*((sma(vol,length)-(sma(vol,length)[4]))/(sma(vol,length)[4]))
vvm=100*(sma(((vm-vm[1])/vm[1]),3))
osc=sma((ema(src,length)-sma(src,lensma)),3)
sig=(osc+2*osc[1]+2*osc[2]+osc[3])/6
cc=osc>0 ? lime : osc<0 ? red: na
cut=abs(vvm/8)> abs(sma(vvm,5)) ?osc/0.7 : na
cv=cut>0 ? aqua : orange 
si=plot(sig,color=cc)
duml=plot((osc>sig?osc:sig), style=circles, linewidth=0, color=gray)
os=plot(osc,color=cc,linewidth=2, title="ROC")
fill(si,duml,color=green,transp=60)
fill(os,duml,color=red,transp=60)
hline(0, title="Zero Line",color=white)
plot(cut,color=cv,style=columns,linewidth=2,transp=60)