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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。