What is the Bollinger Bandwidth Indicator?
The Bollinger Bandwidth indicator is a powerful volatility measurement tool that helps traders identify periods of market consolidation (squeeze) and explosive breakout opportunities (bulge). This indicator measures the width between Bollinger Bands as a percentage of the middle band, providing clear visual signals when volatility contracts or expands.
Understanding volatility patterns is crucial for successful trading. Low volatility periods (squeezes) often precede significant price movements, making this indicator invaluable for timing entries and exits.
How the Bollinger Bandwidth Works
The indicator calculates three key metrics:
- Bandwidth Value: (Upper Band - Lower Band) / Middle Band
- Squeeze Level: Lowest bandwidth over a lookback period (default 20)
- Bulge Level: Highest bandwidth over the same period
When the bandwidth approaches the squeeze level (red zone), it indicates market consolidation and potential breakout setup. When it approaches the bulge level (green zone), it signals high volatility and possible trend exhaustion.
Key Trading Signals
đź”´ Squeeze Signal (Low Bandwidth)
When the bandwidth line moves near or touches the lower red line:
- Market is consolidating with low volatility
- Prepare for potential breakout in either direction
- Set alerts and watch for volume increase
- Ideal for breakout trading strategies
🟢 Bulge Signal (High Bandwidth)
When the bandwidth line approaches the upper green line:
- Market experiencing high volatility
- Existing trend may be overextended
- Consider profit-taking opportunities
- Watch for potential trend reversal
Complete Pine Script Code
Here's the full TradingView indicator code in Pine Script v4. You can copy and paste this directly into your TradingView Pine Editor:
//@version=4
study(title = "Bollinger Bandwidth - Bulge and squeeze", shorttitle = "Bollinger Bandwidth", format=format.price, precision=2, resolution="")
// Input parameters
length = input(20, minval=1)
src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50, title="StdDev")
highlowlength = input(20, minval=1, title="High Low Lookback Short")
// Calculate Bollinger Bands
[main, top, bottom] = bb(src, length, mult)
// Calculate bandwidth
bandwidth = (top-bottom)/main
// Find squeeze and bulge levels
short_lowest = lowest(bandwidth, highlowlength)
short_highest = highest(bandwidth, highlowlength)
// Plot bandwidth line
plot(bandwidth, "Bollinger Bandwidth", color=color.blue)
// Plot squeeze and bulge levels
p1 = plot(short_highest, color=color.green, title="Bulge Level")
p2 = plot(short_lowest, color=color.red, title="Squeeze Level")
// Fill background based on position
fill(p1, p2, color = bandwidth > short_lowest ? color.green : color.red, title="Background")
Parameter Settings Explained
Length (Default: 20)
The period for Bollinger Bands calculation. Standard setting is 20 periods. Use shorter (10-15) for day trading, longer (30-50) for swing trading.
Source (Default: Close)
Price data used for calculation. Close price is standard, but you can experiment with HL2 (high+low)/2 or HLC3 for smoother readings.
Standard Deviation (Default: 2.0)
Multiplier for band width. Standard is 2.0. Higher values (2.5-3.0) make bands wider, lower (1.5) make them tighter.
High Low Lookback (Default: 20)
Period to determine extreme bandwidth levels. Affects sensitivity of squeeze/bulge detection. Increase for less frequent signals, decrease for more.
Practical Trading Strategies
Strategy 1: Squeeze Breakout Trading
- Identify Squeeze: Wait for bandwidth to reach lowest level (red zone)
- Wait for Breakout: Monitor price action for directional move with volume
- Enter Position: Enter when price breaks consolidation with expanding bandwidth
- Set Stop Loss: Place below/above consolidation range
- Target: Previous swing high/low or when bandwidth reaches bulge level
Strategy 2: Mean Reversion at Extremes
- Identify Bulge: Bandwidth near highest level (green zone)
- Look for Exhaustion: Price showing reversal patterns or divergence
- Enter Reversal: Counter-trend position when bandwidth starts contracting
- Target: Middle band or squeeze level
Strategy 3: Trend Confirmation
Use bandwidth expansion to confirm trend strength:
- Expanding bandwidth during uptrend = strong bullish momentum
- Contracting bandwidth during trend = potential weakness or consolidation
- Combine with other indicators (RSI, MACD) for confluence
Combining with Other Indicators
For maximum effectiveness, combine Bollinger Bandwidth with:
- Volume Analysis: Confirm breakouts with volume spikes
- RSI: Check for overbought/oversold conditions during squeezes
- MACD: Identify trend direction before breakout
- Support/Resistance: Mark key price levels for breakout targets
- ATR (Average True Range): Additional volatility confirmation
Best Markets and Timeframes
Ideal Markets:
- Forex Pairs: EUR/USD, GBP/USD (high liquidity, clear squeezes)
- Crypto: BTC, ETH (volatile, frequent squeeze/bulge cycles)
- Stocks: Large-cap stocks with good volume
- Indices: S&P 500, NASDAQ (smooth price action)
Recommended Timeframes:
- Day Trading: 5min, 15min charts
- Swing Trading: 1H, 4H, Daily charts
- Position Trading: Daily, Weekly charts
Common Mistakes to Avoid
❌ Trading Every Squeeze
Not every squeeze leads to significant breakout. Wait for additional confirmation signals like volume increase or support/resistance break.
❌ Ignoring Market Context
Check overall market trend and news events. Major announcements can create false breakouts regardless of bandwidth readings.
❌ Using Single Timeframe
Always check higher timeframe for trend context. A squeeze on 15min chart might be insignificant if 4H shows strong trend.
❌ Poor Risk Management
Always use stop losses. Breakouts can fail, and bandwidth doesn't guarantee direction—only volatility change.
Optimization Tips
- Backtest Your Settings: Test different length and lookback parameters on your specific market and timeframe
- Adjust for Volatility Regime: Use wider bands (higher StdDev) in high volatility markets
- Combine Multiple Lookback Periods: Use both short (20) and long (50) lookbacks for different signal types
- Add Alerts: Set TradingView alerts when bandwidth crosses squeeze/bulge levels
- Screen Multiple Assets: Scan entire watchlist for squeeze setups using TradingView screener
How to Add This Indicator to TradingView
- Open TradingView and go to any chart
- Click on "Pine Editor" at the bottom of the screen
- Copy the complete code from above
- Paste it into the Pine Editor
- Click "Add to Chart" button
- Customize settings in the indicator settings menu (gear icon)
- Save the indicator to your favorites for easy access
Advanced Modifications
Once you're comfortable with the basic indicator, consider these enhancements:
- Multiple Lookback Periods: Plot 20-period and 50-period squeeze levels simultaneously
- Squeeze Counter: Count consecutive periods bandwidth stays in squeeze zone
- Breakout Alerts: Automated alerts when bandwidth expands from squeeze
- Percentile Ranking: Show bandwidth as percentile rank over longer period (200 bars)
- Multi-Timeframe Analysis: Display bandwidth from higher timeframe on current chart
Conclusion
The Bollinger Bandwidth Squeeze indicator is an essential tool for identifying volatility cycles and high-probability trading opportunities. By measuring the contraction and expansion of Bollinger Bands, it provides clear visual signals for potential breakouts and trend exhaustion.
Key Takeaways:
- Squeezes (low bandwidth) signal potential breakouts
- Bulges (high bandwidth) indicate volatility extremes
- Always combine with other indicators and price action
- Practice proper risk management with stop losses
- Backtest settings for your specific trading style
Start using this indicator today to improve your trading timing and identify better entry and exit points. Remember, no indicator is perfect—always use multiple confirmation signals and maintain strict risk management.
Need Custom Indicator Development?
Want to modify this indicator or create custom trading tools tailored to your strategy? I offer professional Pine Script development services with 5+ years of experience.
Hire Me for Custom Development