Skip to content
Menu
Finabase Learn

The indicators that matter Lesson 5 of 10

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
  1. The idea
  2. How the bands are built
  3. The formula
  4. Reading the bands on a real chart: IBM 2025–2026
  5. How traders use Bollinger Bands
  6. A signal that worked and one that failed
  7. Pitfalls and limitations
  8. Comparison table
  9. How Finabase calculates and scores Bollinger Bands
  10. Frequently asked questions
  11. Summary
  12. Check your understanding
  13. Exercise

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.

The idea

Bollinger Bands answer one question: how far from its average does this stock usually close? Measure that distance over the last 20 sessions, draw it above and below the average, and you have the bands. When the stock has been quiet the distance is small and the bands are tight; when it has been jumping the bands spread apart.

How the bands are built · IBM daily, 2025-11-28 to 2026-10-29 $200 $250 $300 1. A 20-day average, with a band each side $0 $20 $40 $60 Widest · Jul 27 Narrowest · Aug 31 2. How far closes strayed from the average Dec Jan 2026 Feb Mar Apr May Jun Jul Aug Sep Oct
How the bands are built, on IBM from November 28, 2025 to October 29, 2026. Panel 2 is the 20-day standard deviation of the close, taken from the bands computed by Finabase. Each band sits two of these away from the middle line.

Panel 2 is the whole mechanism. The line in it is the typical distance between a close and the 20-day average, in dollars. It was largest on July 27, after IBM's July collapse, and smallest on August 31. Look straight up from those two dates: the bands are at their widest and their narrowest.

So the bands do not mark fixed levels. A close outside them means "unusual compared with the last 20 sessions", and the same dollar move that breaks a tight band can stay well inside a wide one.

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 daily with Bollinger Bands (20, 2) and bandwidth · 2025-10-30 to 2026-10-29 $200 $250 $300 Walking the upper band · late May Break above after the squeeze · Sep 9 Price Upper Middle (SMA 20) Lower 20% 40% 60% Squeeze: 4.4% · Aug 31 64.1% · Jul 29 Bandwidth, % of middle band Nov Dec Jan 2026 Feb Mar Apr May Jun Jul Aug Sep Oct
IBM, one year of daily bars with Bollinger Bands (20, 2) as computed by Finabase, and bandwidth (upper minus lower, as a percentage of the middle band) computed from the same bands.

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.

IBM daily with Bollinger Bands (20, 2) and bandwidth · 2025-10-30 to 2026-10-29 $200 $250 $300 Walking the upper band · late May Break above after the squeeze · Sep 9 Price Upper Middle (SMA 20) Lower 20% 40% 60% Squeeze: 4.4% · Aug 31 64.1% · Jul 29 Bandwidth, % of middle band Nov Dec Jan 2026 Feb Mar Apr May Jun Jul Aug Sep Oct

One stock at a time, one year of daily closes, no trading costs. An up signal is a close back above the lower band and a down signal is a close back below the upper band, which is only one of several ways to read the bands. A few signals in one year show how the settings behave, not which setting is best.

A signal that worked and one that failed

The signal is the mean-reversion setup described above: a close below the lower band, then a close back above it. Both charts are IBM in 2026. The shaded area is the period after the signal.

Worked: a close back inside the lower band · IBM daily, 2026-08-27 to 2026-10-29 $200 $220 $240 $260 Back above the lower band · Sep 29 · $219.99 20 sessions later · $250.25 (+13.8%) Price Upper Middle Lower Sep Oct
Worked. IBM closed back above its lower band on September 29, 2026 at $219.99. Twenty sessions later it closed at $250.25, a gain of 13.8%.
Failed: a close back inside the lower band · IBM daily, 2026-01-15 to 2026-03-02 $200 $250 $300 Back above the lower band · Feb 18 · $260.79 4 sessions later · $229.32 (−12.1%) Price Upper Middle Lower Feb Mar
Failed. IBM closed back above its lower band on February 18, 2026 at $260.79. Four sessions later it closed at $229.32, a loss of 12.1%.

In September IBM had been moving sideways since the August squeeze, between about $220 and $250, and the close below the lower band came at the bottom of that range. In February the stock was already in a decline: the lower band had dropped from $288 to $256 in just over three weeks. Price stepped back inside the band for a few sessions and then followed it down. A close back inside the band is a range signal. Before using it, check that the bands are roughly level and that the stock is in a range.

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.

Check your understanding

4 questions on this lesson. Each answer comes with the reason, and nothing is scored.

  1. The 20-day average of a stock’s close is $100 and the 20-day standard deviation is $4. Where are the Bollinger Bands (20, 2)?

    1. $96 and $104
    2. $92 and $108
    3. $80 and $120
    Show the answer

    B. $92 and $108 Each band is two standard deviations from the middle: 100 − 2 × 4 = 92 and 100 + 2 × 4 = 108.

  2. A stock in a strong advance closes above its upper band. What is the most accurate reading?

    1. It is overbought and should be sold
    2. The close is unusually high compared with the last 20 sessions, which is what a strong trend looks like
    3. The bands are set too narrow and need adjusting
    Show the answer

    B. The close is unusually high compared with the last 20 sessions, which is what a strong trend looks like A close outside a band is unusual relative to recent closes. It is not a reversal signal. IBM closed above its upper band five sessions in a row from May 27 to June 2, 2026 while rising 29%.

  3. The bands have narrowed to their tightest in a year. What does this squeeze tell you?

    1. A large move is more likely than usual; its direction is not known
    2. Price will break upward
    3. The trend has ended
    Show the answer

    A. A large move is more likely than usual; its direction is not known Low volatility tends to be followed by high volatility, in either direction. After IBM’s tightest bands on August 31, 2026 the first breakout was upward and reversed within weeks, the head-fake.

  4. In the lab above, keep IBM and switch from 20 · 2 to 10 · 1.5. What happens?

    1. Fewer signals, because the bands are narrower
    2. More than twice as many signals, and about the same share of the up signals worked
    3. The same signals, a few sessions later
    Show the answer

    B. More than twice as many signals, and about the same share of the up signals worked IBM gave 15 signals with the standard bands and 39 with the shorter, narrower ones. Of the up signals, 3 of 6 were followed by a higher close 20 sessions later with 20 · 2 and 10 of 18 with 10 · 1.5. Tighter bands are crossed more often; in this year they were not crossed more usefully.

Exercise

One task to do in Finabase. Nothing is graded or saved.

Open the IBM chart with Bollinger Bands (20, 2). Find the place in the past year where the bands were narrowest. Which way was the first close outside a band after that squeeze, and was the price still on that side of the middle band a month later? Then find a run of several closes in a row outside one band. Did the price reverse there or keep going?

Open the IBM chart with Bollinger Bands
What you should find

A squeeze tends to be followed by a larger move, but the bands do not say which way, and the first break can reverse: the head-fake. A run of closes outside a band usually marks a strong trend walking the band, not a turn. In both cases a close outside a band only means unusual compared with the last 20 sessions.

Sources and further reading

  1. John Bollinger, Bollinger on Bollinger Bands (McGraw-Hill, 2001)
  2. John Bollinger — BollingerBands.com, the author’s rules and FAQ
  3. TA-Lib — BBANDS function reference
  4. Finabase chart data — IBM daily bars, 2025-10-30 to 2026-10-29, Bollinger Bands computed by Finabase