MarcoValente

super bandpass filter by John Ehlers

341
New indicator from John Ehlers, more info traders.com/Document.../07/TradersTips.html , strategy can find in the script
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
//plot by marco
//The Super Passband Filter by John Ehlers
//Buy on the filter crossing above its -RMS line
//Short on the filter crossing below its RMS line
//Exit long when the filter either crosses below its RMS or crosses below -RMS (which signifies a false entry signal)
//Cover short when the filter either crosses above its -RMS or crosses above RMS (which signifies a false entry signal)

study("super bandpass filter",overlay=false)
src=input(close,title="source")
bbs=input(true,"show background colors ?" )
flen=input(40)
slen=input(60)
a1= 5/flen
a2= 5/slen
PB = (a1 - a2) * close + (a2*(1 - a1) - a1 * (1 - a2))* close[1] + ((1 - a1) + (1 - a2))*nz(PB[1])- (1 - a1)* (1 - a2)*nz(PB[2])
RMSa= sum( PB*PB, 50)
RMS= sqrt(RMSa/50)
rms=-RMS
con=crossover(PB,rms) and bbs ?lime: crossunder(PB,RMS) and bbs?red:na
bgcolor(con,transp=80)
plot(PB,title="Pass Band",color=red,linewidth=2)
m=plot(RMS,title="RMS+",color=blue,linewidth=1)
s=plot(rms,title="RMS-",color=lime,linewidth=1)
fill(m,s,color=silver,transp=90)
//sbfa=nz(sbfa[1])*pow((slen-flen)+flen,2)
//sbfma=nz(sbfma[1])+sbfa*(src-nz(sbfma[1]))
//plot(sbfma,color=red,linewidth=2,title=" super bandpass filter MA")