OPEN-SOURCE SCRIPT

Smart Volatility Squeeze + Trend Filter

91
快照
Smart Volatility Squeeze + Trend Filter

This advanced indicator detects low-volatility squeeze conditions and plots breakout signals, helping you spot strong price moves before they happen.

How it works

This script combines Bollinger Bands (BB) and the Keltner Channel (KC) — two popular volatility tools — to identify squeeze setups:

A squeeze occurs when the Bollinger Bands contract and move completely inside the Keltner Channel. This means the market is quiet and volatility is low — often right before a significant breakout.

When the squeeze condition is active, the background highlights the chart area with a soft color that gradually intensifies the longer the squeeze lasts. This gives a clear visual cue that pressure is building.

A breakout signal triggers when price crosses above the upper Bollinger Band (bullish) or below the lower Bollinger Band (bearish) — confirming that the squeeze has ended and a new impulse is likely starting.

To reduce false breakouts, you can enable the built-in trend filter. By default, it uses a simple EMA: breakouts are confirmed only if the price action aligns with the overall trend direction.

Key features

🔹 Bollinger Bands + Keltner Channel squeeze detection
🔹 Automatic squeeze marker and background shading
🔹 Breakout arrows for up and down signals
🔹 Optional trend filter with adjustable EMA length
🔹 Works on any market: crypto, stocks, forex, indices
🔹 Fully adjustable inputs for BB, KC and trend filter
🔹 Built-in ready-to-use alerts for breakouts

How to use

Watch for areas where the squeeze condition appears — the background will highlight them.

Wait for a breakout arrow to appear outside the bands.

Use the trend filter to focus only on breakouts in the dominant trend direction.

Combine with your existing risk management and confirmation tools.

Inputs

BB Length & StdDev: Control the Bollinger Bands settings.

KC EMA Length & ATR Multiplier: Control the Keltner Channel width.

Trend Filter Length: Adjust how smooth or sensitive the trend filter is.

Use Trend Filter: Enable or disable confirmation by trend direction.

Disclaimer

⚠️ This script is for educational purposes only and does not constitute financial advice. Always test any strategy thoroughly and trade at your own risk.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。