OPEN-SOURCE SCRIPT

Volatility Squeeze Scanner MTF [StrixEDGE]

183
Overview

A multi-timeframe volatility squeeze detector that identifies when Bollinger Bands contract inside Keltner Channels across four configurable timeframes simultaneously. The indicator combines squeeze state detection with a LazyBear-method momentum oscillator and a real-time consensus engine, giving traders a structured view of cross-timeframe compression without switching charts.

Volatility squeezes represent periods of contracting price action — energy building before a directional move. Detecting them on a single timeframe is common. Detecting them across multiple timeframes at once isolates the higher-probability setups where compression is structural, not noise.
How It Works

Squeeze Detection
A squeeze fires when the Bollinger Bands (SMA ± standard deviation) fully contract inside the Keltner Channel (SMA ± ATR). This means the upper Bollinger Band is below the upper Keltner Channel AND the lower Bollinger Band is above the lower Keltner Channel. When both conditions hold, volatility has compressed below its average range — the market is coiling.

Bull BIAS snapshot

Bear BIAS snapshot

Momentum Oscillator (LazyBear Method)
The momentum histogram is calculated as the linear regression of the difference between price and the average of the Donchian Channel midline and SMA. This produces a zero-centered oscillator that reveals both the direction and acceleration of momentum inside the squeeze.

The histogram uses a four-tone color scheme:
- Bright green — bullish momentum, accelerating
- Dark green — bullish momentum, decelerating
- Bright red — bearish momentum, accelerating
- Dark red — bearish momentum, decelerating

Squeeze-State Dots
Dots on the zero line change color based on the current chart timeframe's squeeze state:
- Orange dot — squeeze is active (BB inside KC)
- Teal dot — no squeeze (BB outside KC)

The transition from orange to teal marks the moment the squeeze fires — volatility is expanding and the move is underway.

Multi-Timeframe Consensus
The indicator runs the squeeze calculation independently on four user-defined timeframes via `request.security()`. A consensus table displays each timeframe's squeeze state, momentum direction, momentum acceleration, and squeeze duration in real time.

Consensus is reached when the number of timeframes simultaneously in squeeze meets or exceeds the user-defined threshold (default: 3 out of 4). The background subtly highlights when consensus is active, with a brighter flash on the bar where consensus is first reached.

How to Read It

Entry context:
Wait for the consensus row to show 3/4 or 4/4 CONSENSUS — this confirms compression is happening across the timeframe stack, not just locally. The higher the consensus count, the more significant the potential expansion.

Directional bias:
The MOM and DIR columns across timeframes reveal whether momentum is aligned. When most timeframes show BULL + ▲, the bias favors long. When most show BEAR + ▼, the bias favors short. Mixed readings suggest no clear directional edge — patience is warranted.

Timing the release:
Watch the zero-line dots on the current chart timeframe. When the dot transitions from orange (squeeze active) to teal (squeeze released), the coil is unwinding. The histogram's color and direction at that moment indicate the likely direction of the expansion.

Duration as context:
The DUR column shows how many bars each timeframe has been in squeeze. Longer durations generally correspond to larger eventual moves. A fresh squeeze (DUR = 1–3) may still be forming. An extended squeeze (DUR = 15+) is deeply compressed and more likely to produce a significant breakout.

Inputs

Bollinger Bands
- Length — lookback period for the SMA and standard deviation (default: 20)
- Multiplier — standard deviation multiplier for band width (default: 2.0)

snapshot

Keltner Channel
- Length — lookback period for the SMA and ATR (default: 20)
- Multiplier — ATR multiplier for channel width (default: 1.5)

snapshot

Timeframes
- Four independently configurable timeframes (default: 5m, 15m, 1H, 4H)
- Choose timeframes that create meaningful structure for your trading style

snapshot

Consensus
- Minimum TF Consensus — how many timeframes must be in squeeze simultaneously to trigger consensus (2, 3, or 4; default: 3)

snapshot

Momentum
- Momentum Source — price source for all calculations (Close, Open, High, Low, HL2, HLC3, OHLC4)

snapshot

Alerts

5 alert conditions are available:

- Squeeze Consensus Reached — fires when the minimum TF consensus threshold is first met
- Squeeze Consensus Broken — fires when consensus drops below the threshold
- Consensus + Bullish Bias — consensus active with 3+ timeframes showing positive momentum
- Consensus + Bearish Bias — consensus active with 3+ timeframes showing negative momentum
- Full 4/4 Squeeze — all four timeframes in simultaneous squeeze

snapshot

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.