16 — Volatility

Bollinger Bands#

Debated1 min read
◆ The PatternA moving average with bands two standard deviations wide: volatility drawn around the trend

Bollinger Bands — John Bollinger's volatility envelope (1983).

Middle Band = SMA(20)
Upper Band = SMA(20) + 2σ
Lower Band = SMA(20) − 2σ

Bands expand with volatility, contract during quiet periods.

Key concepts:
• Squeeze: Narrow bands → low volatility → big move coming
• Walk the band: In strong trends, price can ride the upper/lower band
• Mean reversion: Price touching outer band → may return to middle
• about 95% of closes would fall inside the 2σ bands if returns were normal; fat tails make it fewer in practice
Worked example

The standard 20-day bands need 20 days, so this uses 5. On day 15 the last five closes average 102.0 with a standard deviation of 1.90, so the bands are 102.0 ± 3.79: 98.21 to 105.79. They were widest on day 7 (110.86 − 99.94 = 10.92), when the rally was fastest. On day 13 the close of 99 sat just above the lower band (98.48).

The example data: 15 days, used in every indicator here
DayHighLowCloseVolume
11019910050,000
210310010262,000
310310010148,000
410510110470,000
510810410785,000
610810510660,000
711010610990,000
811010710872,000
910810410580,000
1010510210366,000
1110510210455,000
1210410110275,000
13102989995,000
141029910164,000
1510510110471,000
Where it misleads
  • A touch of a band is not a signal on its own: in a trend the price “walks the band” for weeks.
  • Two standard deviations would hold about 95% of closes only if they were normal and independent; prices are neither, so breaks are more frequent than that.
  • A squeeze (narrow bands) says volatility is low and a move may follow — not which way.
In code
mid = df['close'].rolling(5).mean()
sd = df['close'].rolling(5).std(ddof=0)       # population SD, as Bollinger uses
df['bb_up'], df['bb_mid'], df['bb_lo'] = mid + 2 * sd, mid, mid - 2 * sd
Python, in your browser — edit the code and run it again

Assumes import numpy as np, import pandas as pd, and a DataFrame df with columns high, low, close and volume — the 15 days above.

Sources
  • J. Bollinger, Bollinger on Bollinger Bands, McGraw-Hill, 2001
  • J. Lento, N. Gradojevic & C. Wright, “Investment information content in Bollinger Bands?”, Applied Financial Economics Letters 3(4), 2007

Last reviewed October 2026 · How this site checks its content · Report a mistake

Check yourself

1. How are standard Bollinger Bands built?

Show answer

C. The bands widen when prices are volatile and narrow when they are calm.

2. The bands narrow sharply (a “squeeze”). What does that tell you?

Show answer

C. Low volatility tends not to last, but a squeeze carries no information about direction.

3. Price touches the upper band. Is that a sell signal?

Show answer

B. Bollinger himself warned against reading touches as signals by themselves.

Pattern bridge: Price mean ± 2σ is a normal distribution confidence band applied to price. In ML, batch normalization standardizes activations the same way — center, then scale by deviation.
Performance in practice
  • A squeeze (unusually low bandwidth) tends to be followed by higher volatility — volatility clusters and mean-reverts — but says nothing reliable about direction
  • Mean-reversion trades (buy lower band, sell upper) work well in ranging markets. In trends, price "walks the band" — touching the upper band is confirmation, not a sell signal
  • Combining Bollinger with Keltner Channels creates the "TTM Squeeze" — a popular volatility breakout system used by active traders
When to use this
✓ Use when: Measuring current volatility vs historical norms. Mean-reversion strategies in ranging markets. Identifying squeeze setups before breakouts. Setting dynamic stop-loss levels.
✗ Skip when: As a standalone buy/sell at the bands. During news events (bands widen after the move, not before). When you need directional bias — bands are non-directional.
Linked from 6
← Previous
Aroon
Open in the full reader, with the topic sidebar