Key Takeaways
Bollinger Bands Mean Reversion
Uses Bollinger Bands to identify when price has moved too far from its average, entering trades expecting price to revert to the mean (middle band).
Market Psychology
Bollinger Bands measure volatility and price deviation. When price touches the outer bands, it has statistically moved 2 standard deviations from average, often creating mean reversion opportunities.
šStrategy Visualization
Price touches lower band then reverses to middle
In-Depth Strategy Guide
Bollinger Bands are a volatility indicator consisting of a middle band (usually a 20-period SMA) and two outer bands set at 2 standard deviations above and below. The bands automatically widen during volatile periods and contract during calm markets.
Mean reversion with Bollinger Bands works because price statistically spends most time near the mean. When price touches an outer band, it has moved 2 standard deviations from average - a statistically significant move that often reverses.
The Bollinger Band Squeeze is one of the most powerful setups. When bands narrow to their tightest in 6+ months, a large move is coming. Traders position for breakouts when the squeeze releases.
Walking the bands occurs in strong trends when price repeatedly touches or exceeds one band. This is NOT a reversal signal - the trend is strong. Only trade mean reversion in ranging, oscillating markets.
Code Examples
import pandas as pd
def bollinger_bands(df, period=20, std_dev=2):
df['bb_middle'] = df['close'].rolling(period).mean()
df['bb_std'] = df['close'].rolling(period).std()
df['bb_upper'] = df['bb_middle'] + (df['bb_std'] * std_dev)
df['bb_lower'] = df['bb_middle'] - (df['bb_std'] * std_dev)
df['bb_width'] = (df['bb_upper'] - df['bb_lower']) / df['bb_middle']
# Mean reversion signals
df['bb_signal'] = 0
df.loc[df['close'] < df['bb_lower'], 'bb_signal'] = 1
df.loc[df['close'] > df['bb_upper'], 'bb_signal'] = -1
return dfThis function calculates Bollinger Bands and generates mean reversion signals when price touches the outer bands.
int CheckBollingerSignal()
{
double upper = iBands(_Symbol, PERIOD_H1, 20, 0, 2, PRICE_CLOSE, MODE_UPPER);
double lower = iBands(_Symbol, PERIOD_H1, 20, 0, 2, PRICE_CLOSE, MODE_LOWER);
double close = Close[0];
if(close < lower) return 1; // Buy at lower band
if(close > upper) return -1; // Sell at upper band
return 0;
}This MQL5 function returns buy/sell signals when price touches Bollinger Band extremes.
šRecommended Python Libraries
š„ Entry Rules
Wait for price to touch or pierce the outer band
Look for rejection candlestick pattern
Confirm RSI is in overbought/oversold territory
Enter on reversal candle close back inside the bands
š¤ Exit Rules
Primary target is the middle band (20 SMA)
Second target is the opposite band
Exit if momentum continues beyond bands
Use the middle band as trailing stop reference
š”ļø Risk Management
Band Width
Narrow bands = low volatility, potential breakout ahead
Stop Loss
Place stops beyond the band extreme with ATR buffer
Trend Awareness
Price can walk the bands in strong trends
Indicators Used
Bollinger Bands (20, 2)
Primary tool for mean reversion signals
RSI
Confirm overbought/oversold at band touches
Volume
Identify exhaustion vs continuation
Best Timeframes
Best Market Conditions
Common Mistakes to Avoid
Pro Tips
Educational Disclaimer
This content is for educational purposes only and does not constitute financial or investment advice. Trading involves significant risk and you may lose your capital. Always consult a licensed financial advisor before making investment decisions.
Frequently Asked Questions
Related Strategies
Support/Resistance Trading
A fundamental strategy that identifies horizontal price levels where buying or selling pressure has historically been strong enough to reverse price direction.
RSI Oscillator Strategy
Uses the Relative Strength Index to identify overbought and oversold conditions, entering reversals when the market has moved too far too fast.
Channel Trading
Trades within parallel trend lines (channels) by buying at the lower boundary and selling at the upper boundary, capturing the oscillation within the channel.