How it works
BandWidth strips the Bollinger envelope down to the only part of it that describes the volatility regime: the distance between the outer bands, expressed as a fraction of the average. Reading compression off the bands themselves is unreliable because the eye judges width against price level and against whatever zoom the chart happens to be at. Plotting width as its own series in a separate pane removes that problem and makes the comparison explicit.
Because the width is divided by the middle band, the result is a percentage of price rather than a raw dollar figure. That normalisation is what makes the series portable. A BandWidth of 0.04 means the two-deviation envelope spans four percent of price, and that statement is directly comparable between a forty-dollar miner and a five-thousand-point index, and between last month and three years ago. Raw band distance and raw ATR do not have that property, which is why comparisons built on them so often mislead.
The practical use is almost entirely about extremes rather than levels. A BandWidth reading at the bottom of its own multi-month range marks a squeeze: realised volatility has compressed, options are usually cheap, and the market is coiled. Because volatility clusters and mean reverts more reliably than price does, that state has genuine predictive content about magnitude. It has none about direction, which is why practitioners pair a BandWidth trough with a structural trigger, typically a break of the range that formed during the compression. At the other end, a BandWidth reading at a multi-year high usually marks the panic phase of a decline rather than a top or a bottom in price.
It is worth being clear about what BandWidth is not. It is not a trend indicator, and rising BandWidth is neither bullish nor bearish on its own. Compared with historical volatility it measures the same underlying quantity but on a much shorter window and without annualisation, so it is noisier and more responsive. Compared with the choppiness index it says how big the moves are rather than how efficiently they travel, and the two can disagree: a market can grind sideways with large individual bars, giving high BandWidth and high choppiness together.
Calculation
The arithmetic in words, in the order it happens.
Build the standard Bollinger set first: a 20-period simple moving average as the middle band and outer bands placed 2 standard deviations of the same 20 closes above and below it. BandWidth is the upper band minus the lower band, divided by the middle band. Since the numerator is exactly twice K times the standard deviation, the series is equivalent to 2K times the standard deviation divided by the average, which is why it reads as a fraction of price. Most platforms multiply by 100 so the value is quoted as a percentage.
Source
An AlgoBeamScript implementation of the formula above, written by us from the arithmetic so the code and the calculation agree line for line.
Runs unchanged on the platform and in the AlgoBeamTS runtime. The language reference is in the documentation.
Inputs
Defaults are the values most charting packages ship with. They are conventions, not optimal settings — the right length depends on your instrument and your holding period.
| Input | Default | What it changes |
|---|---|---|
| Length | 20 | Bars in the underlying average and deviation. Shorter lengths make the width series jumpy and produce many shallow troughs; longer lengths give fewer, more meaningful compression readings but confirm expansion late. |
| Standard deviations | 2 | Scales the whole series by a constant. It changes the numbers on the axis but not the shape, so squeeze rules stated in terms of the series own history are unaffected by it. |
| Source | Close | Series used for the average and deviation. Using high-low based inputs makes the width respond to intrabar range as well as to closing dispersion, which is closer to what ATR measures. |
| Squeeze lookback | 125 | The window against which the current width is judged when the platform draws a lowest-in-N marker. Roughly six months of daily bars is the common choice; shorter windows flag compression far more often and far less meaningfully. |
How to read it
What practitioners take from the plot. Read these as descriptions of market state, not as entry signals.
- Lowest reading in six months
- A genuine squeeze. Expansion tends to follow compression, so position sizing and option pricing should assume the quiet will not last.
- Turning up from a trough
- Volatility is being released. Combined with a break of the range that formed during the squeeze, this is the standard breakout confirmation.
- Sustained high plateau
- A high-volatility regime, typically a decline or a post-shock market. Stops sized on the pre-shock regime will be far too tight here.
- Falling steadily from a spike
- Volatility is normalising after an event. Trend continuation trades often work better in this phase than during the spike itself.
Limitations
Where this indicator misleads. None of these are fixed by a better parameter.
- A squeeze says nothing at all about direction. Trading a BandWidth trough without an independent structural or directional trigger is a coin flip with a wide stop.
- Compression can persist far longer than expected. Low BandWidth is a condition, not a countdown, and markets have held a squeeze for months while option sellers collected and breakout traders bled on false starts.
- The series inherits every quirk of the standard deviation, including the abrupt jump when an outlier bar enters or leaves the twenty-bar window, which can create a false expansion signal on a bar that was otherwise unremarkable.
- On instruments whose price level has changed dramatically, historical comparisons drift even though the series is normalised, because the character of the instrument itself changed.
Educational reference. This page explains how an indicator is built and how it is commonly read. It is not investment advice, not a recommendation and not a signal service. No indicator is profitable on its own — each is a way of describing a market, and any rule built on one has to be tested with realistic costs before it is traded.