OPEN-SOURCE SCRIPT
Squeeze Channel

Squeeze Channel
Volatility compression is one of the most reliable precursors to significant price movement. When markets consolidate, energy builds—like a coiled spring waiting to release. This indicator detects these compression phases using the classic squeeze methodology, then captures the consolidation range as a tradeable channel. The tighter the squeeze, the more potential energy stored for the eventual breakout.
What makes this approach effective is the combination of volatility-based timing with price structure. Rather than blindly trading every squeeze release, the indicator defines clear breakout levels based on the actual swing highs and lows formed during compression. This creates objective entry triggers while the squeeze intensity gradient (yellow → red) helps gauge the quality of the setup before committing.
How It Works
Squeeze Detection
The indicator identifies periods of volatility compression when Bollinger Bands contract inside Keltner Channels. A 5-color gradient (yellow → orange → red) visualizes squeeze intensity in real-time—the tighter the squeeze, the closer to red.
Channel Formation
When a squeeze begins, the indicator captures a swing high/low channel:
- Lookback: Grabs the highest high and lowest low over the past N bars
- Lookforward: Allows the channel to expand if price exceeds bounds in the first few bars
- Lock: Once the expansion window closes, the channel locks in place
The channel persists until price breaks out, regardless of whether the squeeze has ended.
Signal Types
Primary Signals
Bullish Breakout | 🔼 Teal Triangle | Close above channel high
Bearish Breakout | 🔽 Red Triangle | Close below channel low
Failed Breakout Reversals
When enabled, the indicator watches for failed breakouts—price breaks one direction then reverses through the opposite channel bound.
Bull Reversal | 💎 Cyan Diamond | Failed bear breakout, reclaims above
Bear Reversal | 💎 Magenta Diamond | Failed bull breakout, breaks below
Extended S/R Retest Signals
After a breakout, channel levels are stored as support/resistance for future retests. These levels remain invisible until price approaches within a user-defined ATR distance.
S/R Bull Breakout | 🔼 Faded Triangle | Breaks above extended resistance
S/R Bear Breakout | 🔽 Faded Triangle | Breaks below extended support
S/R Bull Reversal | 💎 Faded Diamond | Reclaims extended support
S/R Bear Reversal | 💎 Faded Diamond | Rejected at extended resistance
Settings
Squeeze Detection
- Bollinger Length (default: 12) — Shorter length = tighter bands, easier squeeze entry
- Bollinger Multiplier (default: 2.0)
- Keltner Length (default: 20)
- Keltner ATR Multiplier (default: 2.0) — Higher = wider channel, easier squeeze entry
Channel Settings
- Swing Lookback Bars (default: 5) — Bars to look back for initial channel
- Swing Lookforward Bars** (default: 3) — Bars to allow channel expansion
Reversal Detection
- Enable Failed Breakout Reversal — Toggle reversal signals on/off
- Reversal Watch Bars (default: 7) — How long to watch for failed breakout
Extended S/R
- Show Extended S/R Levels — Display historical channel levels
- Enable S/R Retest Signals — Toggle retest signals on/off
- Extended Level Bars (default: 50) — How long levels remain active
- S/R Signal Delay Bars (default: 5) — Delay before retest signals activate (filters noise)
- ATR Proximity Threshold (default: 1.0) — Distance for level visibility
- ATR Length (default: 14)
Visual Guide
- Colored dots = Active squeeze channel (gradient shows intensity)
- Fuchsia dots = Channel waiting for breakout (squeeze ended)
- Faded teal/red dots = Extended S/R levels (appear on proximity)
- Triangles = Breakout signals
- Diamonds = Reversal signals (failed breakouts)
Volatility compression is one of the most reliable precursors to significant price movement. When markets consolidate, energy builds—like a coiled spring waiting to release. This indicator detects these compression phases using the classic squeeze methodology, then captures the consolidation range as a tradeable channel. The tighter the squeeze, the more potential energy stored for the eventual breakout.
What makes this approach effective is the combination of volatility-based timing with price structure. Rather than blindly trading every squeeze release, the indicator defines clear breakout levels based on the actual swing highs and lows formed during compression. This creates objective entry triggers while the squeeze intensity gradient (yellow → red) helps gauge the quality of the setup before committing.
How It Works
Squeeze Detection
The indicator identifies periods of volatility compression when Bollinger Bands contract inside Keltner Channels. A 5-color gradient (yellow → orange → red) visualizes squeeze intensity in real-time—the tighter the squeeze, the closer to red.
Channel Formation
When a squeeze begins, the indicator captures a swing high/low channel:
- Lookback: Grabs the highest high and lowest low over the past N bars
- Lookforward: Allows the channel to expand if price exceeds bounds in the first few bars
- Lock: Once the expansion window closes, the channel locks in place
The channel persists until price breaks out, regardless of whether the squeeze has ended.
Signal Types
Primary Signals
Bullish Breakout | 🔼 Teal Triangle | Close above channel high
Bearish Breakout | 🔽 Red Triangle | Close below channel low
Failed Breakout Reversals
When enabled, the indicator watches for failed breakouts—price breaks one direction then reverses through the opposite channel bound.
Bull Reversal | 💎 Cyan Diamond | Failed bear breakout, reclaims above
Bear Reversal | 💎 Magenta Diamond | Failed bull breakout, breaks below
Extended S/R Retest Signals
After a breakout, channel levels are stored as support/resistance for future retests. These levels remain invisible until price approaches within a user-defined ATR distance.
S/R Bull Breakout | 🔼 Faded Triangle | Breaks above extended resistance
S/R Bear Breakout | 🔽 Faded Triangle | Breaks below extended support
S/R Bull Reversal | 💎 Faded Diamond | Reclaims extended support
S/R Bear Reversal | 💎 Faded Diamond | Rejected at extended resistance
Settings
Squeeze Detection
- Bollinger Length (default: 12) — Shorter length = tighter bands, easier squeeze entry
- Bollinger Multiplier (default: 2.0)
- Keltner Length (default: 20)
- Keltner ATR Multiplier (default: 2.0) — Higher = wider channel, easier squeeze entry
Channel Settings
- Swing Lookback Bars (default: 5) — Bars to look back for initial channel
- Swing Lookforward Bars** (default: 3) — Bars to allow channel expansion
Reversal Detection
- Enable Failed Breakout Reversal — Toggle reversal signals on/off
- Reversal Watch Bars (default: 7) — How long to watch for failed breakout
Extended S/R
- Show Extended S/R Levels — Display historical channel levels
- Enable S/R Retest Signals — Toggle retest signals on/off
- Extended Level Bars (default: 50) — How long levels remain active
- S/R Signal Delay Bars (default: 5) — Delay before retest signals activate (filters noise)
- ATR Proximity Threshold (default: 1.0) — Distance for level visibility
- ATR Length (default: 14)
Visual Guide
- Colored dots = Active squeeze channel (gradient shows intensity)
- Fuchsia dots = Channel waiting for breakout (squeeze ended)
- Faded teal/red dots = Extended S/R levels (appear on proximity)
- Triangles = Breakout signals
- Diamonds = Reversal signals (failed breakouts)
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
discord.gg/REapC6SGtz
b3artrades@gmail.com
b3artrades@gmail.com
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
discord.gg/REapC6SGtz
b3artrades@gmail.com
b3artrades@gmail.com
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.