OPEN-SOURCE SCRIPT
Range Breakout by AV

Range Compression Breakout
Volatility compression and expansion system
Range Compression Breakout automatically detects periods of low-volatility consolidation, draws and maintains the range in real time, and signals when price transitions into expansion.
How it works
Compression is measured relative to the market's own recent behavior rather than a fixed price distance. In Adaptive Percentile mode, a range qualifies when its high-low span sits among the quietest percentile of its recent history — so the same settings work across futures, FX, crypto, and equities without retuning. ATR Multiple mode is also available for a fixed volatility-based threshold.
Once a range is detected, the box is dynamic. While price stays contained, the box expands to absorb new highs and lows, capturing the full churn of the consolidation instead of resetting on every probe.
Signals
Break — price closes decisively beyond the boundary plus a buffer, with optional multi-bar confirmation and an optional volume-spike filter.
Wick Long / Wick Short — a failed probe outside the range that closes back inside on a long wick, confirmed by the following bar, indicating mean reversion toward the midline.
A cooldown period after each break prevents the box from immediately reforming on the expansion move.
Settings
Four preset profiles — Tight Ranges for low-timeframe scalping, Normal Ranges for intraday, Swing Trading for multi-day consolidations, and Options Selling for extended sideways chop — each configuring lookback, tightness, minimum bars, confirmation, and cooldown. Custom mode exposes all parameters. Box fill, borders, midline, and signal colors are fully adjustable, and each signal type toggles independently.
Alerts
Range Detected, Range Breakout, Breakout with Volume Confirmation, and Range Reversal.
Notes
Volume confirmation should be left off on spot FX and other symbols reporting tick-based volume. Diagnostic values including the range-to-ATR ratio and compression state are available in the Data Window for calibration.
Volatility compression and expansion system
Range Compression Breakout automatically detects periods of low-volatility consolidation, draws and maintains the range in real time, and signals when price transitions into expansion.
How it works
Compression is measured relative to the market's own recent behavior rather than a fixed price distance. In Adaptive Percentile mode, a range qualifies when its high-low span sits among the quietest percentile of its recent history — so the same settings work across futures, FX, crypto, and equities without retuning. ATR Multiple mode is also available for a fixed volatility-based threshold.
Once a range is detected, the box is dynamic. While price stays contained, the box expands to absorb new highs and lows, capturing the full churn of the consolidation instead of resetting on every probe.
Signals
Break — price closes decisively beyond the boundary plus a buffer, with optional multi-bar confirmation and an optional volume-spike filter.
Wick Long / Wick Short — a failed probe outside the range that closes back inside on a long wick, confirmed by the following bar, indicating mean reversion toward the midline.
A cooldown period after each break prevents the box from immediately reforming on the expansion move.
Settings
Four preset profiles — Tight Ranges for low-timeframe scalping, Normal Ranges for intraday, Swing Trading for multi-day consolidations, and Options Selling for extended sideways chop — each configuring lookback, tightness, minimum bars, confirmation, and cooldown. Custom mode exposes all parameters. Box fill, borders, midline, and signal colors are fully adjustable, and each signal type toggles independently.
Alerts
Range Detected, Range Breakout, Breakout with Volume Confirmation, and Range Reversal.
Notes
Volume confirmation should be left off on spot FX and other symbols reporting tick-based volume. Diagnostic values including the range-to-ATR ratio and compression state are available in the Data Window for calibration.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.