OPEN-SOURCE SCRIPT
Squeeze & Structure

Title: Ultimate Squeeze & Market Structure
Description: This all-in-one trading system combines two of the most powerful concepts in technical analysis: Volatility Compression (The Squeeze) and Market Structure (SMC).
It is designed to solve the biggest problem breakout traders face: False Breakouts. By waiting for a Volatility Squeeze to release energy, and confirming it with a structural Break of Structure (BoS) or Change of Character (CHoCH), traders can identify high-probability setups with precision.
How It Works (The "Trifecta" Logic):
1. The Energy (The Squeeze): Using the classic TTM Squeeze logic, the indicator monitors the relationship between Bollinger Bands (price volatility) and Keltner Channels (average range).
Red Cloud: Volatility is compressed. The market is coiling like a spring. This is the Setup Phase.
Breakout: When price expands outside the bands, the energy is released.
2. The Structure (SMC & ZigZag): Built on a custom Non-Repainting ZigZag engine, the indicator objectively maps swing highs and lows to define the trend.
BoS (Break of Structure): Signals trend continuation. Price breaks a previous pivot in the direction of the trend.
CHoCH (Change of Character): Signals potential reversal. Price breaks a significant pivot in the opposite direction of the trend.
Ghost Line: A dotted line shows the live, developing leg of the ZigZag before it is confirmed, helping you anticipate the next pivot.
3. The Confluence (The Strategy): The most powerful signals occur when these two forces align.
Example: A Red Squeeze releases into a Bullish Breakout (Fuchsia Cloud), immediately followed by a Bullish CHoCH. This confirms that not only is volatility expanding, but the structural trend has officially reversed to the upside.
Visual Guide:
☁️ Cloud Colors (Volatility):
🟥 Red: Squeeze ON (Consolidation).
🟣 Fuchsia: Bullish Momentum Breakout.
🔵 Blue: Bearish Momentum Breakout.
🟡 Yellow: Armed/Waiting for Pullback (if Pullback mode is active).
⬜ Gray/Green: Normal Trending.
🏷️ Labels (Structure):
H / L: Confirmed Swing Highs and Lows.
BoS: Break of Structure (Trend Continuation).
CHoCH: Change of Character (Trend Reversal).
Features:
Dual Entry Modes: Choose between "Breakout" (immediate signal) or "Pullback" (waits for a retest of the midline).
Momentum Filter: Breakouts are only colored if the 20 SMA slope agrees with the direction.
Fully Customizable: Adjust ZigZag Sensitivity (Depth/Deviation), Squeeze lengths, and all colors.
Alerts: Triggers available for Squeeze Start, Breakouts, and Armed status.
Credits: This script incorporates concepts from the TTM Squeeze and standard Smart Money Concepts (SMC) market structure analysis. It uses a custom, non-repainting pivot detection algorithm to ensure historical accuracy.
Description: This all-in-one trading system combines two of the most powerful concepts in technical analysis: Volatility Compression (The Squeeze) and Market Structure (SMC).
It is designed to solve the biggest problem breakout traders face: False Breakouts. By waiting for a Volatility Squeeze to release energy, and confirming it with a structural Break of Structure (BoS) or Change of Character (CHoCH), traders can identify high-probability setups with precision.
How It Works (The "Trifecta" Logic):
1. The Energy (The Squeeze): Using the classic TTM Squeeze logic, the indicator monitors the relationship between Bollinger Bands (price volatility) and Keltner Channels (average range).
Red Cloud: Volatility is compressed. The market is coiling like a spring. This is the Setup Phase.
Breakout: When price expands outside the bands, the energy is released.
2. The Structure (SMC & ZigZag): Built on a custom Non-Repainting ZigZag engine, the indicator objectively maps swing highs and lows to define the trend.
BoS (Break of Structure): Signals trend continuation. Price breaks a previous pivot in the direction of the trend.
CHoCH (Change of Character): Signals potential reversal. Price breaks a significant pivot in the opposite direction of the trend.
Ghost Line: A dotted line shows the live, developing leg of the ZigZag before it is confirmed, helping you anticipate the next pivot.
3. The Confluence (The Strategy): The most powerful signals occur when these two forces align.
Example: A Red Squeeze releases into a Bullish Breakout (Fuchsia Cloud), immediately followed by a Bullish CHoCH. This confirms that not only is volatility expanding, but the structural trend has officially reversed to the upside.
Visual Guide:
☁️ Cloud Colors (Volatility):
🟥 Red: Squeeze ON (Consolidation).
🟣 Fuchsia: Bullish Momentum Breakout.
🔵 Blue: Bearish Momentum Breakout.
🟡 Yellow: Armed/Waiting for Pullback (if Pullback mode is active).
⬜ Gray/Green: Normal Trending.
🏷️ Labels (Structure):
H / L: Confirmed Swing Highs and Lows.
BoS: Break of Structure (Trend Continuation).
CHoCH: Change of Character (Trend Reversal).
Features:
Dual Entry Modes: Choose between "Breakout" (immediate signal) or "Pullback" (waits for a retest of the midline).
Momentum Filter: Breakouts are only colored if the 20 SMA slope agrees with the direction.
Fully Customizable: Adjust ZigZag Sensitivity (Depth/Deviation), Squeeze lengths, and all colors.
Alerts: Triggers available for Squeeze Start, Breakouts, and Armed status.
Credits: This script incorporates concepts from the TTM Squeeze and standard Smart Money Concepts (SMC) market structure analysis. It uses a custom, non-repainting pivot detection algorithm to ensure historical accuracy.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。