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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。