Bollinger Bands are unique among indicators because they measure volatility itself, not just price direction. Day 11 teaches you the Squeeze, the Breakout, and the Walk.
Bollinger Band Construction
Middle Band = 20 SMA | Upper Band = 20 SMA + (2 × StdDev) | Lower Band = 20 SMA − (2 × StdDev)
Statistically, ~95% of price action falls within the bands. When price touches the upper band — it's 2 standard deviations above the 20-day average. That's extreme.
import pandas as pd
def bollinger_bands(df, window=20, num_std=2):
df['bb_mid'] = df['Close'].rolling(window).mean()
std = df['Close'].rolling(window).std()
df['bb_upper'] = df['bb_mid'] + num_std * std
df['bb_lower'] = df['bb_mid'] - num_std * std
df['bb_width'] = (df['bb_upper'] - df['bb_lower']) / df['bb_mid']
return df
The Three Key Patterns
1. The Squeeze
Bands narrow to their tightest point in months. Volatility is compressed. A major move is building — direction unknown yet. Wait for the breakout direction, then trade accordingly.
2. The Breakout
Price closes outside the bands on high volume. This confirms a genuine directional move is starting. Not a mean-reversion signal — rather, follow the breakout.
3. The Walk
In a strong uptrend, price "walks" along the upper band — touching it multiple sessions in a row. Don't short just because price is at the upper band. This is a strength signal.
Mean Reversion Setup
Price tags lower band + bullish candle + RSI oversold + at support → buy for a bounce to middle band.
Common Mistake
Buying just because price hit the lower band. Always combine with support and momentum confirmation.
%B Indicator%B = (Price − Lower Band) / (Upper − Lower). Above 1 = price above upper band. Below 0 = below lower band. Use this to quantify where price sits within the bands.
Today's Watch
Find 3 stocks where Bollinger Bands are at a multi-month squeeze (narrowest width). Add them to your watchlist and wait for the breakout with volume confirmation.