Bollinger Bands — John Bollinger's volatility envelope (1983).
Upper Band = SMA(20) + 2σ
Lower Band = SMA(20) − 2σ
Bands expand with volatility, contract during quiet periods.
• 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
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
| Day | High | Low | Close | Volume |
|---|---|---|---|---|
| 1 | 101 | 99 | 100 | 50,000 |
| 2 | 103 | 100 | 102 | 62,000 |
| 3 | 103 | 100 | 101 | 48,000 |
| 4 | 105 | 101 | 104 | 70,000 |
| 5 | 108 | 104 | 107 | 85,000 |
| 6 | 108 | 105 | 106 | 60,000 |
| 7 | 110 | 106 | 109 | 90,000 |
| 8 | 110 | 107 | 108 | 72,000 |
| 9 | 108 | 104 | 105 | 80,000 |
| 10 | 105 | 102 | 103 | 66,000 |
| 11 | 105 | 102 | 104 | 55,000 |
| 12 | 104 | 101 | 102 | 75,000 |
| 13 | 102 | 98 | 99 | 95,000 |
| 14 | 102 | 99 | 101 | 64,000 |
| 15 | 105 | 101 | 104 | 71,000 |
- 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.
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
Assumes import numpy as np, import pandas as pd, and a DataFrame df with columns high, low, close and volume — the 15 days above.
- 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
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.
- 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
- Pattern EssaysThe Coiled SpringQuiet gathers before loud. A narrowing range warns about size, not direction
- ML MathBatch NormalizationNormalizing activations to keep training stable and fast
- ML MathNormalization VariantsLayerNorm, RMSNorm, GroupNorm — which normalisation for which architecture
- The Toolkitpandas-ta & yfinanceTechnical indicators + market data in one-liners
- Timeseries EngineeringFeature EngineeringTurning raw timestamps into predictive signals
- Timeseries EngineeringGARCHModeling volatility that clusters