OPEN-SOURCE SCRIPT
업데이트됨 Range Detector [NJ]

✧ 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.
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.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.