samuelhei

Snake Oscillator

This Oscillator helps to identify the ending of waves, good to get entries and exits.

New version:
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("Snake Oscillator","SNK_OSC")

len = input(25,"Length")

h = ema(high,len)
l = ema(low,len)


hp = h/h[len]
lp = l/l[len]
 
avg = avg(hp,lp)

havg = ema(highest(avg,len),len)
lavg = ema(lowest(avg,len),len)


pa = plot(avg,color=gray)
ph = plot(havg,color=gray)
pl = plot(lavg,color=gray)

fill(ph,pa,color=red,transp=60)
fill(pl,pa,color=green,transp=60)