OPEN-SOURCE SCRIPT
Volatility Regime Breakout [Squeeze + ATR + Trend + PreAlert]

Volatility Regime Breakout [Squeeze + ATR + Trend]
A hybrid indicator combining three layers of confirmation to detect the birth of high-volatility regimes and filter out low-quality entries in sideways markets.
How it works:
🔹 Squeeze (BB vs KC): detects when Bollinger Bands compress inside Keltner Channels — a low-volatility phase that historically precedes strong directional moves.
🔹 Pre-Alert: before the release, the indicator measures whether the compression is accelerating (band-width contraction) to give you early warning (purple background + ⚠ icon) that an entry may be developing — this is not an entry signal, it's an early heads-up.
🔹 Expansion confirmation (ATR Ratio): on squeeze release, the script requires the ATR to be genuinely expanding relative to its baseline, filtering out false breakouts with no real range/momentum behind them.
🔹 Trend direction (EMA + slope): only generates a buy/sell signal when the breakout aligns with the underlying trend direction, avoiding counter-trend entries on the first impulse.
Includes:
Three distinct background states: normal squeeze, pre-alert, confirmed breakout
BUY/SELL signals on bar close only (no repainting)
Suggested Stop Loss / Take Profit levels based on ATR (visual reference only, not automatic execution)
Independent, configurable alerts for pre-alert and confirmed entry, with custom messages
All sensitivity parameters are adjustable from the settings panel
Recommended for: BTC and high-volatility crypto assets, 1h timeframe and above to reduce noise.
⚠️ This script is a technical analysis tool, not an automated trading system or financial advice. SL/TP levels are for reference only. We recommend validating the logic through your own backtesting before using it on a live account, and always applying proper risk management.
A hybrid indicator combining three layers of confirmation to detect the birth of high-volatility regimes and filter out low-quality entries in sideways markets.
How it works:
🔹 Squeeze (BB vs KC): detects when Bollinger Bands compress inside Keltner Channels — a low-volatility phase that historically precedes strong directional moves.
🔹 Pre-Alert: before the release, the indicator measures whether the compression is accelerating (band-width contraction) to give you early warning (purple background + ⚠ icon) that an entry may be developing — this is not an entry signal, it's an early heads-up.
🔹 Expansion confirmation (ATR Ratio): on squeeze release, the script requires the ATR to be genuinely expanding relative to its baseline, filtering out false breakouts with no real range/momentum behind them.
🔹 Trend direction (EMA + slope): only generates a buy/sell signal when the breakout aligns with the underlying trend direction, avoiding counter-trend entries on the first impulse.
Includes:
Three distinct background states: normal squeeze, pre-alert, confirmed breakout
BUY/SELL signals on bar close only (no repainting)
Suggested Stop Loss / Take Profit levels based on ATR (visual reference only, not automatic execution)
Independent, configurable alerts for pre-alert and confirmed entry, with custom messages
All sensitivity parameters are adjustable from the settings panel
Recommended for: BTC and high-volatility crypto assets, 1h timeframe and above to reduce noise.
⚠️ This script is a technical analysis tool, not an automated trading system or financial advice. SL/TP levels are for reference only. We recommend validating the logic through your own backtesting before using it on a live account, and always applying proper risk management.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.