Free TradingView Range and Breakout Indicator

Draws confirmed price ranges with their boundaries, midpoint, and internal pivots. It offers alerts for range formation and breaks.

Free, open-source Pine Script by AlgoAlpha. TradingView account and plan limits apply.

TradingView chart preview of Ranges and Breakouts by AlgoAlpha.
Published AlgoAlpha chart preview. The layout depends on your chart and inputs.

Inputs to start with

Lookback and confirmation windows
The first window supplies price history. The confirmation setting affects how long the script looks for a range before a box appears.
Pivot Detection Length
Controls the sensitivity of the dots plotted around highs and lows. A pivot can become visible only after later bars confirm it.
Allow Internal Ranges
Enable this to display smaller ranges inside an existing box. Leave it off if a single outer boundary is easier to track.

Try it on a chart

Start Replay before a consolidation. Record when the box first becomes visible and draw its upper and lower boundaries. For the first breach, record whether price closed outside the box or only wicked beyond it. Repeat with a different confirmation window and compare how early each box was available.

What to check. A range only appears after the configured confirmation period. Check when the box first becomes visible.