OPEN-SOURCE SCRIPT
Обновлено

Range Detector [NJ]

255
✧ OVERVIEW ✧

Range Detector identifies and highlights potential ranging market structures using pivot highs and lows combined with a two-stage confirmation process.
Confirmed ranges are displayed as boxes and remain active until price closes beyond the allowed tolerance.
снимок

✧ SETTINGS ✧

Range Tolerance %
Controls how far price may close beyond the range before it is invalidated.

Range First Confirmation %
Controls the first retracement required after both range boundaries have formed.

Range Second Confirmation %
Controls the second reversal required after the first confirmation.

Bars to Confirm the Range
Controls how long the current candidate structure may remain unconfirmed before it expires.

Pivot High/Low Lookback
Controls pivot sensitivity. Lower values detect smaller and more frequent swings, while higher values focus on larger market structures.

✧ HOW IT WORKS ✧
снимок
Range Formation
The indicator uses pivot highs and lows to define potential range boundaries. Newer same-side pivots may replace earlier ones until both boundaries are established.

Two-Stage Confirmation
A range is confirmed only after two rotations.
With the default 70% / 50% settings:
High → Low: price retraces 70% toward the high, then returns to 50%.
Low → High: price retraces 70% toward the low, then returns to 50%.

Range Invalidation
The range remains active until price closes beyond a boundary by more than the selected tolerance, measured as a percentage of the range height.

Candidate Timeout
Unconfirmed candidates must complete the confirmation sequence within the selected number of bars. Otherwise, they are discarded. The timer may restart if a newer same-side pivot replaces the current candidate.

✧ VISUALIZATION ✧
снимок
Once confirmed, the range is displayed as a box between its upper and lower boundaries.

The box is drawn retrospectively from the earliest pivot used to form the range and extends forward until the range is invalidated.

Because pivot highs and lows require future bars to be confirmed, the beginning of a range can appear several bars before the indicator could have known that the pivot was valid in real time.

✧ USAGE ✧

Range Detector can be used to identify areas of:

Sideways price action
Consolidation
Mean-reversion conditions
Support and resistance
Potential breakout structures

The detected zones can provide additional market structure context for range trading, breakout analysis, or filtering trend-following setups.

As with any technical indicator, it is best used alongside other forms of analysis rather than as a standalone entry or exit signal.
Информация о релизе
Short title correction.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.