Bollinger Bands
systemic:core-bbIndicatorsfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| Window | integer | - **Description**; The window refers to the number of periods used to calculate the simple moving average (SMA) for the Middle Band. |
| Deviation Window | integer | - **Description**; The deviation window specifies the number of standard deviations to add or subtract from the moving average to calculate the Upper and Lower Bands. |
| Price Data | floatarray | - **Description**; This is the historical price data of the asset you are analyzing. Typically, the closing prices are used, but some traders might use other price data such as open, high, or low prices. |
Outputs
| Name | Type | Description |
|---|---|---|
| Upper Band | floatarray | - **Description**; The Upper Band is calculated by adding a specified number of standard deviations to the Middle Band. |
| Lower Band | floatarray | - **Description**; The Lower Band is calculated by subtracting a specified number of standard deviations from the Middle Band. |
| Simple Moving Average | floatarray | - **Description**; The Middle Band is a simple moving average (SMA) of the price data over a specified window period. |
| Upper Band Indicator | floatarray | - **Description**; The hband indicator is a signal that indicates when the price is near or crossing the upper Bollinger Band. |
| Lower Band Indicator | floatarray | - **Description**; The lband indicator is a signal that indicates when the price is near or crossing the lower Bollinger Band. |
A practical guide to using Bollinger Bands for identifying volatility regimes, overbought/oversold conditions, and trading opportunities in both traditional and crypto markets.
Overview
Bollinger Bands are a popular technical analysis tool developed by John Bollinger in the 1980s. They consist of three lines plotted on a price chart:
- Middle Band: A simple moving average (SMA) of the asset's price, typically over 20 periods.
- Upper Band: Two standard deviations above the Middle Band.
- Lower Band: Two standard deviations below the Middle Band.
Why Bollinger Bands matter:
- Volatility insight: Bands expand and contract with volatility, helping traders spot regime shifts.
- Overbought/oversold detection: Price touching or exceeding bands can signal stretched conditions.
- Breakout and reversal signals: Band squeezes and expansions often precede major moves.
- Cross-asset utility: Used in stocks, forex, commodities, and crypto.
Quick links:
- Investopedia: Bollinger Bands
- Binance Academy: Bollinger Bands
- Fidelity: Bollinger Bands
- John Bollinger's Official Site
How It Works
Bollinger Bands use a moving average and standard deviation to create a dynamic channel around price. The width of the bands adapts to volatility, widening during high volatility and narrowing during low volatility.
Formulas
Middle Band (MB):
Where is the number of periods (commonly 20).
Upper Band (UB):
Where is the number of standard deviations (commonly 2), and is the standard deviation over periods.
Lower Band (LB):
Calculation Flow
flowchart TD
Price[Price Series] --> SMA[Calculate SMA]
Price --> STD[Calculate Standard Deviation]
SMA --> UB[Upper Band]
SMA --> LB[Lower Band]
STD --> UB
STD --> LB
Interpretation and Use Cases
Typical Ranges
- Bands: Dynamic, based on volatility. Wider = more volatile, narrower = less volatile.
- Price vs Bands: Price near upper band = potential overbought; near lower band = potential oversold.
Signal Logic
- Band Squeeze: Bands contract tightly—volatility is low, a breakout may be imminent.
- Band Expansion: Bands widen—volatility is high, often after a breakout.
- Price Touches/Breaks Band: May signal overbought/oversold, but not always a reversal—context matters.
- Walk the Band: In strong trends, price can ride the upper or lower band for extended periods.
Use Case 1: Stock Mean Reversion
- Scenario: S&P 500 stock price closes below the lower band after a long uptrend.
- Interpretation: Potential oversold condition; traders may look for a bounce or reversal.
- Reference: Fidelity: BB in Stock Trading
Use Case 2: Crypto Volatility Breakout
- Scenario: Bitcoin's bands squeeze tightly, then price breaks above the upper band on high volume.
- Interpretation: Volatility expansion; traders may enter momentum trades in the direction of the breakout.
- Reference: Binance Academy: BB in Crypto
Use Case 3: Trend Confirmation
- Scenario: Ethereum price rides the upper band for several days.
- Interpretation: Confirms a strong uptrend; traders may hold or add to positions, not fade the move.
Use Case 4: Volatility Regime Change
- Scenario: Bands contract to their narrowest in months on a major index.
- Interpretation: Precursor to a large move; traders prepare for breakout setups.
Decision Flow Example
flowchart TD
S[New Candle Closes] --> A{Bands Squeezed?}
A -->|Yes| B[Prepare for Breakout]
A -->|No| C{Price Touches Upper Band?}
C -->|Yes| D[Check for Overbought or Trend]
C -->|No| E{Price Touches Lower Band?}
E -->|Yes| F[Check for Oversold or Trend]
E -->|No| G[No Signal]
Comparison: Bollinger Bands vs. Other Volatility Indicators
| Indicator | Measures | Output | Best For |
|---|---|---|---|
| Bollinger Bands | Std. dev. of price | Dynamic bands | Overbought/oversold, breakouts |
| Keltner Channel | ATR (volatility) | Bands | Trend following, volatility |
| ATR | True range (volatility) | Price units | Stop-loss, regime detection |
| Donchian Channel | Price highs/lows | Bands | Breakouts, trend confirmation |
- Bollinger Bands use standard deviation, making them sensitive to outliers and volatility spikes.
- Keltner Channels use ATR, so they are smoother and less reactive to price jumps.
- Donchian Channels focus on price extremes, not volatility.
Practical Example
Suppose you analyze a 20-day period for a stock:
- 20-day SMA (MB) = $100
- 20-day standard deviation () = $5
- = 2
Upper Band:
Lower Band:
| Day | Close | MB (SMA) | σ | UB | LB |
|---|---|---|---|---|---|
| 20 | 102 | 100 | 5 | 110 | 90 |
Band Squeeze and Breakout Visualization
flowchart TD
P[Band Squeeze Detected] --> Q[Monitor for Breakout]
Q --> R{Breakout Direction?}
R -->|Up| S[Enter Long or Momentum Trade]
R -->|Down| T[Enter Short or Hedge]
Missing Data
BB needs Price Data on a bar for it to count; a missing bar (data gap, weekend, holiday) never
gets a fabricated value — it shows as a gap on every one of the five outputs, never a stale
carried-forward band or a sentinel 0. The Window setting means N bars actually observed, not
N calendar slots: on a market-closed gap, the moving average and standard deviation keep counting
back through real bars, bridging straight from the last session before the gap to the first
session after it. Until the first window observed bars accumulate, Upper Band/Lower
Band/Middle Band have no value yet. The two indicator outputs (Upper/Lower Band Indicator) follow
the same rule: at a gap or during warm-up they are also a gap, never the false "0" a naive
close-vs-band comparison would produce against a missing band.
Advantages and Limitations
Advantages:
- Adapts to volatility, providing dynamic support/resistance (Investopedia)
- Useful for both mean reversion and breakout strategies
- Works across all asset classes and timeframes
Limitations:
- Can give false signals in strong trends (Binance Academy)
- Not predictive—should be combined with other indicators (e.g., RSI, volume)
- Subjective interpretation; requires experience
References and Further Reading
- Investopedia: Bollinger Bands
- Binance Academy: Bollinger Bands
- Fidelity: Bollinger Bands
- John Bollinger's Official Site
- TradingView: Bollinger Bands
Glossary
- Volatility: The degree of variation in price over time
- Standard Deviation (σ): A measure of how spread out prices are from the average
- SMA (Simple Moving Average): The average price over a set number of periods
- Band Squeeze: When the bands contract tightly, indicating low volatility
- Breakout: A price move outside a defined range, often with increased volatility
- Mean Reversion: The tendency for price to return to its average
For best results, use Bollinger Bands with other indicators and always backtest your strategy before live trading.
Indicator Assessment
---
config:
xyChart:
width: 600
height: 400
themeVariables:
xyChart:
plotColorPalette: "#9b59b6, #f39c12"
---
xychart-beta horizontal
title "Bollinger Bands Assessment (Scale: 1-10)"
x-axis ["Popularity", "Reliability", "Complexity", "Versatility", "Recent Interest"]
y-axis "Score" 0 --> 10
bar [10, 7, 3, 9, 8]
bar [9, 6, 3, 9, 9]
Legend: First bar (purple) = Equities/Forex | Second bar (orange) = Cryptocurrency
Dimension Explanations
| Dimension | Equities/Forex | Crypto | Rationale |
|---|---|---|---|
| Popularity | 10 | 9 | One of the most widely used technical indicators globally. Standard on all charting platforms. Developed by John Bollinger in the 1980s with dedicated following. Extremely popular in crypto trading communities. |
| Reliability | 7 | 6 | Excellent for volatility measurement and mean reversion in range-bound markets. Less reliable in strong trends where price "walks the band." In crypto, false signals more common due to higher volatility. |
| Complexity | 3 | 3 | Simple concept: moving average with standard deviation bands. Easy to interpret visually. Requires practice to avoid false signals. |
| Versatility | 9 | 9 | Supports multiple trading styles: mean reversion, breakout, trend-following. Works across all timeframes. The squeeze/expansion pattern is universally applicable. |
| Recent Interest | 8 | 9 | Continued strong interest in traditional markets. Very popular in crypto for identifying volatility cycles and breakout setups. Featured in countless educational resources and trading systems. |