OPEN-SOURCE SCRIPT
Advanced Volatility Squeeze Pro v2 [identityKa]

Overview
The Advanced Volatility Squeeze Pro v2 [identityKa] is a comprehensive breakout and momentum oscillator. It is designed to identify periods of market consolidation (volatility compression) and mathematically anticipate the direction of the ensuing breakout. This script improves upon traditional squeeze models by replacing the often-lagging linear regression momentum with a highly responsive dual-EMA momentum engine.
Core Mathematical Concepts
This indicator relies on the mathematical relationship between two distinct volatility envelopes:
Bollinger Bands (Standard Deviation): Calculates the standard deviation of price around a Simple Moving Average (default length 20, multiplier 2.0). These bands expand and contract rapidly based on immediate price variance.
Keltner Channels (True Range): Calculates an envelope based on the Simple Moving Average of the True Range (default multiplier 1.5). These bands are less sensitive to sudden spikes and represent the baseline volatility.
The Squeeze Logic (Dots)
The script continuously compares the width of the Bollinger Bands to the Keltner Channels:
Squeeze ON (Red Dots): Triggered when the Bollinger Bands completely contract inside the Keltner Channels. This signifies a severe drop in volatility. The market is consolidating, building energy for a future move.
Squeeze OFF (Gray Dots): Triggered when the Bollinger Bands expand back outside the Keltner Channels. This mathematical event is known as the squeeze "firing," indicating a release of volatility and the start of a new directional trend.
The Momentum Engine (Histogram)
To determine the direction of the breakout, the script calculates the spread between a Fast EMA (default 8) and a Slow EMA (default 21).
The histogram plots this exact difference.
A rising positive histogram (Bright Green) indicates accelerating bullish momentum, while a falling negative histogram (Bright Red) indicates accelerating bearish momentum.
HUD Dashboard & AI Logic
The on-chart panel aggregates these calculations into an actionable state:
Dangerous: Displayed whenever the Squeeze is "ON". This warns traders that the market is range-bound and breakout direction is mathematically uncertain.
LONG: Triggered when the Squeeze fires (OFF), the momentum is positive (Fast EMA > Slow EMA), and the momentum value is actively rising compared to the previous bar.
SHORT: Triggered when the Squeeze fires (OFF), the momentum is negative, and actively falling.
How to Use It
Traders should avoid entering trend-continuation setups while the red dots (Squeeze ON) are present. The optimal setup occurs when a red dot transitions to a gray dot (Squeeze fires) in confluence with the AI Suggestion outputting a clear "LONG" or "SHORT" signal, allowing the trader to capture the explosive expansion in volatility.
The Advanced Volatility Squeeze Pro v2 [identityKa] is a comprehensive breakout and momentum oscillator. It is designed to identify periods of market consolidation (volatility compression) and mathematically anticipate the direction of the ensuing breakout. This script improves upon traditional squeeze models by replacing the often-lagging linear regression momentum with a highly responsive dual-EMA momentum engine.
Core Mathematical Concepts
This indicator relies on the mathematical relationship between two distinct volatility envelopes:
Bollinger Bands (Standard Deviation): Calculates the standard deviation of price around a Simple Moving Average (default length 20, multiplier 2.0). These bands expand and contract rapidly based on immediate price variance.
Keltner Channels (True Range): Calculates an envelope based on the Simple Moving Average of the True Range (default multiplier 1.5). These bands are less sensitive to sudden spikes and represent the baseline volatility.
The Squeeze Logic (Dots)
The script continuously compares the width of the Bollinger Bands to the Keltner Channels:
Squeeze ON (Red Dots): Triggered when the Bollinger Bands completely contract inside the Keltner Channels. This signifies a severe drop in volatility. The market is consolidating, building energy for a future move.
Squeeze OFF (Gray Dots): Triggered when the Bollinger Bands expand back outside the Keltner Channels. This mathematical event is known as the squeeze "firing," indicating a release of volatility and the start of a new directional trend.
The Momentum Engine (Histogram)
To determine the direction of the breakout, the script calculates the spread between a Fast EMA (default 8) and a Slow EMA (default 21).
The histogram plots this exact difference.
A rising positive histogram (Bright Green) indicates accelerating bullish momentum, while a falling negative histogram (Bright Red) indicates accelerating bearish momentum.
HUD Dashboard & AI Logic
The on-chart panel aggregates these calculations into an actionable state:
Dangerous: Displayed whenever the Squeeze is "ON". This warns traders that the market is range-bound and breakout direction is mathematically uncertain.
LONG: Triggered when the Squeeze fires (OFF), the momentum is positive (Fast EMA > Slow EMA), and the momentum value is actively rising compared to the previous bar.
SHORT: Triggered when the Squeeze fires (OFF), the momentum is negative, and actively falling.
How to Use It
Traders should avoid entering trend-continuation setups while the red dots (Squeeze ON) are present. The optimal setup occurs when a red dot transitions to a gray dot (Squeeze fires) in confluence with the AI Suggestion outputting a clear "LONG" or "SHORT" signal, allowing the trader to capture the explosive expansion in volatility.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.