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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.