Bollinger Bands
Introduction
Bollinger Bands are a popular technical analysis tool created by John Bollinger in the 1980s. They consist of a middle band (the moving average) and two outer bands (standard deviations above and below the moving average). Bollinger Bands are used to measure market volatility and help identify overbought and oversold conditions.
Calculation of Bollinger Bands
Bollinger Bands consist of three lines:
- Middle Band: This is typically a simple moving average (SMA) of the closing prices over a specified period.
- Upper Band: This band is calculated by adding a specified number of standard deviations (usually 2) to the middle band.
- Lower Band: This band is calculated by subtracting the same number of standard deviations from the middle band.
Formulas
- Middle Band (SMA):
- Upper Band:
- Lower Band:
Where:
- ( n ) is the number of periods (e.g., 20 days).
- ( k ) is the number of standard deviations (typically 2).
Example Calculation
Let’s consider a simple example using hypothetical closing prices for a stock over 5 days:
Day | Closing Price |
---|---|
1 | $20 |
2 | $22 |
3 | $24 |
4 | $23 |
5 | $25 |
- Calculate the 5-Day SMA:
Calculate the Standard Deviation:
- First, calculate the variance.
- Differences from the mean:
- (20 - 22.8)² = 7.84
- (22 - 22.8)² = 0.64
- (24 - 22.8)² = 1.44
- (23 - 22.8)² = 0.04
- (25 - 22.8)² = 4.84
- Sum of squares: ( 7.84 + 0.64 + 1.44 + 0.04 + 4.84 = 14.80 )
- Variance: ( \frac{14.80}{5} = 2.96 )
- Standard Deviation: ( \sqrt{2.96} \approx 1.72 )
Calculate Upper and Lower Bands:
- Upper Band:
- Lower Band:
Final Bands
- Middle Band: 22.8
- Upper Band: 26.24
- Lower Band: 19.36
Python Code
Interpretation of Bollinger Bands
Volatility
- Narrow Bands: Indicate low volatility and potential price consolidation.
- Widening Bands: Indicate high volatility and increased price movement.
Overbought and Oversold Conditions
- Prices touching or exceeding the upper band may indicate overbought conditions (potential sell signal).
- Prices touching or dropping below the lower band may indicate oversold conditions (potential buy signal).
Trend Confirmation
- Prices consistently riding the upper band can indicate a strong uptrend.
- Prices consistently riding the lower band can indicate a strong downtrend.
Analogy
Think of Bollinger Bands like a rubber band around prices. When prices are stable and the market is calm, the rubber band (the bands) is tight. When market activity increases and prices start to fluctuate significantly, the rubber band stretches, indicating higher volatility. Just as a rubber band may snap back to its original shape after being stretched, prices tend to revert to the middle band when they approach the upper or lower bands.
Conclusion
Bollinger Bands are a versatile tool that helps traders understand market volatility and identify potential buy or sell signals. By examining price movements relative to the bands, traders can make more informed decisions regarding their trades.
References
- Bollinger, J. (2002). Bollinger on Bollinger Bands. McGraw-Hill.
- Investopedia: Bollinger Bands
- TradingView: Bollinger Bands