OPEN-SOURCE SCRIPT
Advanced Bollinger Bands Optimized - Precision Signals

This indicator creates an advanced Bollinger Bands system with integrated ATR bands and intelligent trading signals. It features:
**Core Components:**
- Standard Bollinger Bands (20-period SMA with 1.382 standard deviations)
- ATR-based outer bands expanding on the Bollinger Bands
- Dynamic bandwidth analysis using Z-Score to measure current volatility relative to historical levels
**Market State Detection:**
Identifies five market conditions based on bandwidth Z-Score:
- Extreme Squeeze (ultra-low volatility)
- Squeeze (low volatility)
- Normal (average volatility)
- Expansion (high volatility)
- Extreme Expansion (ultra-high volatility)
**Signal System:**
Generates 5 bullish and 5 bearish signals:
*Bullish Signals:*
1. Bottom Divergence - Price makes new lows while Z-Score is relatively high
2. Width Reversal - Bandwidth rebounds from extreme squeeze
3. Extreme Squeeze Reversal - Recovery from extreme volatility compression
4. Squeeze Breakout Up - Price breaks above upper band during squeeze
5. State Transition - Market transitions from squeeze to expansion
*Bearish Signals:*
1. Top Divergence - Price makes new highs while Z-Score is relatively low
2. Width Reversal - Bandwidth declines from extreme expansion
3. Extreme Expansion Reversal - Contraction from extreme volatility expansion
4. Squeeze Breakout Down - Price breaks below lower band during squeeze
5. State Transition - Market transitions from expansion to squeeze
**Features:**
- Real-time signal table showing active signals
- Adjustable sensitivity parameters for divergence, reversal, and breakout signals
- Signal cooldown system to prevent duplicate alerts
- Clean visual display with band fills and alert markers
- No additional external indicators required
This tool helps traders identify volatility changes, trend reversals, and breakout opportunities using only price data and bandwidth analysis.
**Core Components:**
- Standard Bollinger Bands (20-period SMA with 1.382 standard deviations)
- ATR-based outer bands expanding on the Bollinger Bands
- Dynamic bandwidth analysis using Z-Score to measure current volatility relative to historical levels
**Market State Detection:**
Identifies five market conditions based on bandwidth Z-Score:
- Extreme Squeeze (ultra-low volatility)
- Squeeze (low volatility)
- Normal (average volatility)
- Expansion (high volatility)
- Extreme Expansion (ultra-high volatility)
**Signal System:**
Generates 5 bullish and 5 bearish signals:
*Bullish Signals:*
1. Bottom Divergence - Price makes new lows while Z-Score is relatively high
2. Width Reversal - Bandwidth rebounds from extreme squeeze
3. Extreme Squeeze Reversal - Recovery from extreme volatility compression
4. Squeeze Breakout Up - Price breaks above upper band during squeeze
5. State Transition - Market transitions from squeeze to expansion
*Bearish Signals:*
1. Top Divergence - Price makes new highs while Z-Score is relatively low
2. Width Reversal - Bandwidth declines from extreme expansion
3. Extreme Expansion Reversal - Contraction from extreme volatility expansion
4. Squeeze Breakout Down - Price breaks below lower band during squeeze
5. State Transition - Market transitions from expansion to squeeze
**Features:**
- Real-time signal table showing active signals
- Adjustable sensitivity parameters for divergence, reversal, and breakout signals
- Signal cooldown system to prevent duplicate alerts
- Clean visual display with band fills and alert markers
- No additional external indicators required
This tool helps traders identify volatility changes, trend reversals, and breakout opportunities using only price data and bandwidth analysis.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.