indicator · own pane · open source
Bollinger Bandwidth
Running…
Loading chart…
About
Bollinger Bandwidth is the width of the Bollinger Bands normalised by the middle band. The cleanest volatility indicator for squeeze detection.
- Lowest 1% of readings = squeeze setups.
- A re-expansion after a squeeze is the canonical breakout entry.
- Pair with %B for direction-of-break confirmation.
Source code
//@version=5
indicator("Bollinger Bandwidth", overlay=false)
len = input.int(20, "Length", minval=2, maxval=200)
mult = input.float(2, "Mult", minval=0.5, maxval=5, step=0.1)
src = input.source("close", "Source")
bw = ta.bbw(src, len, mult)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
p_Bandwidth = plot(bw, "Bandwidth", color=color.orange, linewidth=2)
alertcondition(bw < ta.lowest(bw, 100)[1], "Squeeze low", "Bandwidth at a 100-bar low")
alertcondition(ta.crossover(bw, ta.lowest(bw, 100)[1]), "Squeeze release", "Bandwidth expanding from a squeeze")
No comments yet.
Sign in to comment.