anticipated

Null's Master BBand Squeeze Indicator

79
Uses Bollinger band widths with limits set by a proprietary quadratic formula.
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="Null's Master BBand Squeeze Indicator", shorttitle="Null BBW Master")
source = close
threshold = input(.1083)
length = input(40, minval=1), mult = input(1.0, minval=0.001, maxval=50)
basis = sma(source, length)
dev = mult * stdev(source, length)
upper = basis + dev
lower = basis - dev
bbw = (upper-lower)/basis
overlayMode=input(false)
plot(not overlayMode ? bbw : na, color=blue)

add=(7E-18*pow(interval,5))+(-6E-14*pow(interval,4))+(2E-10*pow(interval,3))-(3E-7*pow(interval,2))+(.0002*(interval)+.001)


v=isintraday==false ? threshold : add
hline(v)

c=close<basis?red:green
bgcolor(bbw<=v?c:na,0)