Indicators · Volatility
Bollinger Bands: formula, the squeeze and walking the bands
How Bollinger Bands set a two-standard-deviation envelope around a 20-day average, a worked IBM example, the squeeze and band walks, and how Finabase scores them.
On this page
Bollinger Bands are an envelope around price that widens when the market is volatile and narrows when it is quiet. The middle band is a 20-day simple moving average; the upper and lower bands sit two standard deviations above and below it. John Bollinger developed them in the early 1980s, and they are now among the most widely used tools on any chart.
The bands do not predict direction. They define what "relatively high" and "relatively low" mean right now, given recent volatility, and they show when volatility itself is unusually low or high. This guide calculates the bands by hand on IBM's chart, then uses IBM's very volatile 2026, with a 29% surge in five sessions and a 40% slide, to show the squeeze, the head-fake and walking the bands. It also explains how Finabase scores the bands, which is the opposite of the way many people read them.
How the bands are built
A standard deviation measures how spread out a set of numbers is around their average. If the last 20 closes were all nearly the same, the standard deviation is small; if they swung widely, it is large. Placing bands two standard deviations from the 20-day average gives an envelope that adapts automatically: tight in calm markets, wide in turbulent ones.
If closes were normally distributed around the average, about 95% would fall inside ±2 standard deviations. Prices are not normally distributed and the average moves, so in practice more closes land outside the bands than that, but the idea gives the bands their meaning: a close outside them is unusual relative to the recent past.
The formula
A worked example on IBM
On October 29, 2026, IBM closed at $258.28. From the 20 closes ending that day:
| Step | Calculation | Result |
|---|---|---|
| Middle band (20-day SMA) | average of the 20 closes | $237.12 |
| Standard deviation (σ) | population form over 20 closes | $12.88 |
| Upper band | 237.12 + 2 × 12.88 | $262.88 |
| Lower band | 237.12 − 2 × 12.88 | $211.35 |
| Bandwidth | (262.88 − 211.35) ÷ 237.12 | 21.7% |
| %B | (258.28 − 211.35) ÷ 51.53 | 0.91 |
All three bands match Finabase's chart. With a %B of 0.91, IBM closed near the top of its band, after a rally from about $220 in late September.
Reading the bands on a real chart: IBM 2025–2026
IBM had a turbulent year. It closed at $310.06 at the end of October 2025, fell to the low $220s in February, surged to a high of $332.46 on June 2, collapsed to $199.19 on July 23, and ended at $258.28.
Closes outside the bands
IBM closed above its upper band on 20 sessions and below its lower band on 11, about one session in eight, well above the 5% that a normal distribution would suggest. Volatile stocks spend more time outside their bands.
Walking the band
From May 27 to June 2, 2026, IBM closed above its upper band five days in a row while the stock went from $255.20 to $329.23, a gain of 29%. A trader who read the first close above the band as "overbought, sell" would have missed the entire move. Bollinger's own rule is that tags of the bands are not signals by themselves: in a strong trend, price can walk up the upper band or down the lower one.
The squeeze and the head-fake
Bollinger noted that very low volatility tends to be followed by high volatility. The narrowest bands of IBM's year came on August 31, 2026, with a bandwidth of just 4.4% and the stock at $233.87, about a month after the bandwidth had peaked at 64.1% in the July collapse.
The first break out of the squeeze was upward: IBM closed above its upper band on September 9 at $239.94 and again on September 11–15, closing as high as $249.09. Then it reversed. On September 28 it closed below the lower band at $220.67, 8.0% below the September 9 breakout close. Bollinger calls this the head-fake: the first move out of a squeeze is often in the wrong direction. After the head-fake, IBM rallied again, to $253.44 twenty sessions later.
How traders use Bollinger Bands
Relative highs and lows. The bands define high and low relative to recent volatility. Bollinger pairs them with other indicators, for example a momentum or volume measure, to decide whether a tag of the band is strength or exhaustion.
The squeeze. Low bandwidth flags a coiled market. Traders prepare for a breakout but wait for confirmation, given the head-fake.
Band walks. In strong trends, repeated closes outside a band, or riding along it, confirm the trend rather than reverse it.
W bottoms and M tops. A second low that holds inside the lower band after a first low outside it (or the mirror at a top) is a classic Bollinger pattern that %B makes easy to see.
Mean reversion in ranges. In sideways markets, closes outside the bands followed by a close back inside are a common fade-the-extreme setup.
Pitfalls and limitations
Not a signal on their own. Touching or closing outside a band says price is unusual relative to the last 20 days, nothing more.
Lag. The middle band is a 20-day SMA, and the standard deviation uses the same 20 closes. After a shock, the bands widen sharply and stay wide for 20 sessions.
Direction-neutral squeezes. A squeeze says a big move is likely, not which way.
Comparison table
| Tool | Centre line | Band width from | Typical use |
|---|---|---|---|
| Bollinger Bands | SMA (20) | 2 standard deviations of closes | Relative high/low, squeezes |
| Keltner Channels | EMA (20) | Multiple of ATR | Trend channels |
| Fixed % envelopes | SMA | Fixed percentage | Simple overextension |
| CCI | SMA of typical price | Mean deviation | Overbought/oversold, trends |
See Simple moving average (SMA): formula, crossovers and limits, Average True Range (ATR): volatility, stops and position size and Commodity Channel Index (CCI): formula, ±100 and two readings.
How Finabase calculates and scores Bollinger Bands
Finabase computes the bands with TA-Lib's BBANDS function on closing prices, with a simple moving average and the population standard
deviation. A new BBANDS study ("Bollinger Bands") defaults to a period of 20 and a deviation of 2, both adjustable, and draws the
upper, middle and lower bands on the price chart. The ready-made "Bollinger Bands" chart template pairs them with MACD and Momentum.
In the technical gauge on the symbol page and in the Scanner, Finabase reads the bands as a breakout signal: a close at or above the upper band counts as Bullish, a close at or below the lower band as Bearish, and anything in between is neutral. That is the band-walk reading, not the "overbought" one. The Scanner lists the stocks whose close crossed above the upper or below the lower band, with the date. As IBM's September head-fake shows, a breakout flag is a description of the day, not a forecast.
Frequently asked questions
What do Bollinger Bands tell you?
Whether price is high or low relative to its recent average, measured in units of recent volatility, and whether volatility itself is unusually low (a squeeze) or high (an expansion).
Is touching the upper Bollinger Band a sell signal?
Not by itself. In strong uptrends price can walk along the upper band for days, as IBM did in late May 2026. Bollinger recommends confirming with other indicators.
What is the Bollinger Band squeeze?
A period when the bands are unusually narrow relative to their recent history. It often precedes a large move. The first move out of a squeeze is sometimes a false one.
What settings should I use?
Bollinger's standard is 20 periods and 2 standard deviations, Finabase's default. He suggests 2.1 for a 50-period average and 1.9 for a 10-period one to keep a similar share of closes inside.
Summary
Bollinger Bands surround a 20-day average with bands two standard deviations wide, so they breathe with volatility. IBM's 2026 chart showed their main lessons: price can walk outside a band during a 29% surge, a squeeze to 4.4% bandwidth preceded large moves, and the first breakout from that squeeze was a head-fake. Use the bands to define relative highs and lows and to spot volatility regimes, and confirm direction with something else.
Sources and further reading
- John Bollinger, Bollinger on Bollinger Bands (McGraw-Hill, 2001)
- John Bollinger — BollingerBands.com, the author’s rules and FAQ
- TA-Lib — BBANDS function reference
- Finabase chart data — IBM daily bars, 2025-10-30 to 2026-10-29, Bollinger Bands computed by Finabase