Bollinger BandWidth With AlertsBollinger BandWidth (BBW) + Compression/Exhaustion Alerts
This indicator plots Bollinger BandWidth (BBW) to help you identify volatility regimes: when the market is compressing (coiling) vs expanding (in price discovery).
What it shows
BBW (Blue): Current Bollinger BandWidth as a % of the basis (SMA).
Highest Expansion (Red): The highest BBW value over the last N bars (lookback).
Lowest Contraction (Green): The lowest BBW value over the last N bars (lookback).
Key Features
✅ Compression Detection
Triggers when BBW is near the Lowest Contraction line (volatility squeeze / balance phase).
✅ Exhaustion / Peak Expansion Detection
Triggers when BBW is near the Highest Expansion line (strong expansion / potential late-stage move).
✅ Configurable “Near Zone” Thresholds
Use:
Near Lowest Contraction (%) → how close BBW must be above the contraction extreme
Near Highest Expansion (%) → how close BBW must be below the expansion extreme
Alerts Included
BBW Compression (Near Lowest Contraction)
BBW Exhaustion (Near Highest Expansion)
Alerts are designed to be used with “Once per bar close” to avoid noise during bar formation.
How to use (simple)
Compression alert (C): Start watching for breakout / value setups (market is coiling).
Exhaustion alert (E): Be cautious chasing moves; watch for transitions or rebalancing.
Inputs
BB Length, Source, StdDev
Expansion/Contraction lookback length (hidden by default)
Near-zone thresholds for compression/exhaustion alerts
Indicador Pine Script®














