◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Indicators / Bollinger BandWidth
Volatility indicator

Bollinger BandWidth

A single line that turns 'the Bollinger Bands look tight' into a measurable number, so squeezes can be defined precisely instead of eyeballed.

Illustrative diagram — not live market data.

What it is

Bollinger BandWidth is a derivative of Bollinger Bands, described by John Bollinger himself as a way to quantify how far apart the upper and lower bands are at any moment. Instead of visually judging whether the bands 'look tight' on a chart, BandWidth expresses the gap between the bands as a fraction (or percentage) of the middle band, plotted as one line in a separate pane. Low readings mean the bands have contracted — recent price movement has been small relative to its average — and high readings mean they have expanded. A 'squeeze' is typically identified when BandWidth falls to its lowest value over a chosen lookback window, such as the past 125 bars, making the squeeze a testable condition rather than a subjective impression. BandWidth measures realized volatility that has already occurred: it is descriptive, not predictive, and a contraction says nothing about which direction any later expansion will take. This is educational material, not financial advice, and all trading carries risk of loss.

How it works

BandWidth starts from the standard Bollinger Band construction: a middle band (by default a 20-period simple moving average of the close) plus an upper and lower band set two standard deviations of price above and below that average. BandWidth is then (upper band − lower band) / middle band, often multiplied by 100 to read as a percentage. Because the band gap equals two times the standard-deviation term on each side, BandWidth is effectively a normalized measure of the rolling standard deviation of price: when recent closes cluster tightly, the standard deviation shrinks and BandWidth falls; when closes disperse, it rises. Dividing by the middle band is the important step — it makes readings comparable across different price levels and across time, so a stock at 500 and a pair at 1.08 can both be judged on the same relative scale. To identify a squeeze deterministically, the current BandWidth is compared against its own minimum over a lookback window (Bollinger suggested six months of daily bars, roughly 125): if today's value is the lowest in that window, the market is at maximum contraction by that definition. The statistical point worth stating plainly: low volatility tends to precede a change in volatility, never a known direction.

How traders read it

Common settings

The underlying bands almost always use the standard Bollinger defaults: a 20-period SMA basis with a 2.0 standard-deviation multiplier on the close. The squeeze lookback is a separate choice — 125 bars (about six months of daily data) is the value Bollinger described, though shorter windows flag squeezes more often and longer windows flag only rarer extremes. Changing the band length, multiplier, or lookback changes every squeeze identification, so any comparison should state its settings explicitly.

Strengths

Pitfalls to watch

Pine v6 example

//@version=6
indicator("Bollinger BandWidth", overlay = false)

length   = input.int(20, "Band Length", minval = 1)
mult     = input.float(2.0, "StdDev Multiplier", minval = 0.1, step = 0.1)
src      = input.source(close, "Source")
lookback = input.int(125, "Squeeze Lookback", minval = 2)

basis = ta.sma(src, length)
dev   = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

bandwidth   = (upper - lower) / basis * 100
lowestBW    = ta.lowest(bandwidth, lookback)
isSqueeze   = bandwidth == lowestBW and barstate.isconfirmed

plot(bandwidth, "BandWidth %", color = color.blue)
plot(lowestBW,  "Lowest in Lookback", color = color.new(color.gray, 40))
plotshape(isSqueeze, "Squeeze", style = shape.circle, location = location.bottom, color = color.orange, size = size.tiny)
alertcondition(isSqueeze, "BandWidth Squeeze", "BandWidth at lowest value in lookback window")

Pro tip: Define your squeeze condition in code before you look at the chart — 'lowest BandWidth in 125 bars' is a rule you can test, while 'the bands look tight' is a story you can retrofit to any chart. And keep the honest framing front and center: a contraction tells you volatility has been low, never which direction it resolves. Pair any squeeze reading with independent price analysis and defined risk. This is educational content only, not financial advice; all trading carries risk of loss.

Built an indicator from this? Run it through the Validator to catch look-ahead bias and repainting, or convert a strategy to Pine Script.

Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro