MarcoValente

Leading Oscillator

238
Leading Oscillator and trigger from Ehlers, John F. - Cybernetic Analysis for Stocks and Futures
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?
//@version=2
// from Ehlers, John F. - Cybernetic Analysis for Stocks and Futures
study(title="Leading Oscillator",overlay=false)
pr=hl2
l=input(1,title="Moment len")
a1=input(.25,title="alfa 1",step=0.01)
a2=input(.33,title="alfa 2",step=0.01)
le=2*pr+(a1-2)*pr[l]+(1-a1)*nz(le[1])
nl=a2*le+(1-a2)*nz(nl[1])
ema=.5*pr+.5*nz(ema[1])
dif=nl-ema
ll=2*dif-dif[2]
plot(dif, color=silver,histbase=0, linewidth=2,transp=40,style=columns,title="lead")
plot(ll,title="trigger",color=lime,linewidth=1,transp=0)