OPEN-SOURCE SCRIPT
Adaptive Range Opportunity Hunter [SMI] v1.3

Adaptive Range Opportunity Hunter [SMI]
This indicator was created as an experimental tool to help identify potential entry opportunities near the end of a trading session, with the intention of evaluating positions that may be held for at least the following trading day rather than relying on frequent same-day scalping.
The underlying idea is simple: instead of evaluating price using a fixed absolute threshold, the script measures where the current price is located inside its own recent local range.
By default, the indicator uses the highest and lowest prices of the previous 40 bars as a local price reference. This value was selected empirically after observing that, on many charts, approximately 40 bars often contain around one or two recent price cycles. It should therefore be understood as a practical local reference rather than a universal cycle length.
The main metric, Distance from Local Low %, represents the normalized position of the current close relative to the lowest price in that local range:
0% means price is at the local low.
3% means price is inside the lowest 3% of the local range.
50% represents approximately the middle of the range.
100% corresponds to the local high.
The complementary Distance from Local High % provides the symmetric measurement from the upper extreme. Both values are continuously displayed so users can experiment with their own thresholds.
The default research condition combines two elements:
SMI <= -40
Distance from Local Low <= 3%
This identifies situations where momentum is in an oversold SMI region while price is simultaneously located very close to the lower extreme of its recent local range.
The 3% threshold is not a predicted loss, stop-loss, or expected downside. It simply describes the price's normalized location within the recent high-low range.
The indicator also calculates a Standardized Benefit to Local High %. This represents the hypothetical percentage distance from the configured lower-range threshold to the current local high. It is intended to help compare simultaneous opportunities between different symbols. It is not an expected return or price target.
Intended use
My initial research use is to review signals near the end of the trading day and evaluate whether the resulting positions can be held into at least the following session. The goal is to explore a slower operational approach than habitual intraday scalping and reduce reliance on repeated same-day round trips.
The indicator exposes both the raw measurements and combined SMI conditions, allowing users to test different ideas such as:
Distance from Local Low below 1%, 2%, 3%, 5%, etc.
Local-range proximity without SMI confirmation.
Local-range proximity combined with SMI oversold conditions.
Symmetric conditions near the local high.
Alerts are included so users can monitor multiple symbols and be notified when a new condition appears.
Experimental status
This is a research indicator, not a trading system and not a recommendation to buy or sell. The default values of 40 bars, 3%, and SMI ±40 are intentionally kept as an initial reference rather than presented as universally optimal parameters.
Community feedback is especially welcome regarding different symbols, markets, timeframes and threshold values. One of the purposes of publishing the script is to evaluate whether the observed behavior remains useful outside the instruments and historical examples used during its development.
Credits
The Stochastic Momentum Index calculation is based on the original TradingView implementation by UCSgears. The original source also credits Surjith S M for part of the overbought/oversold visualization.
This adaptation adds the local rolling-range framework, normalized distance measurements, configurable opportunity conditions, standardized local-range comparison, alerts and dashboard.
This indicator was created as an experimental tool to help identify potential entry opportunities near the end of a trading session, with the intention of evaluating positions that may be held for at least the following trading day rather than relying on frequent same-day scalping.
The underlying idea is simple: instead of evaluating price using a fixed absolute threshold, the script measures where the current price is located inside its own recent local range.
By default, the indicator uses the highest and lowest prices of the previous 40 bars as a local price reference. This value was selected empirically after observing that, on many charts, approximately 40 bars often contain around one or two recent price cycles. It should therefore be understood as a practical local reference rather than a universal cycle length.
The main metric, Distance from Local Low %, represents the normalized position of the current close relative to the lowest price in that local range:
0% means price is at the local low.
3% means price is inside the lowest 3% of the local range.
50% represents approximately the middle of the range.
100% corresponds to the local high.
The complementary Distance from Local High % provides the symmetric measurement from the upper extreme. Both values are continuously displayed so users can experiment with their own thresholds.
The default research condition combines two elements:
SMI <= -40
Distance from Local Low <= 3%
This identifies situations where momentum is in an oversold SMI region while price is simultaneously located very close to the lower extreme of its recent local range.
The 3% threshold is not a predicted loss, stop-loss, or expected downside. It simply describes the price's normalized location within the recent high-low range.
The indicator also calculates a Standardized Benefit to Local High %. This represents the hypothetical percentage distance from the configured lower-range threshold to the current local high. It is intended to help compare simultaneous opportunities between different symbols. It is not an expected return or price target.
Intended use
My initial research use is to review signals near the end of the trading day and evaluate whether the resulting positions can be held into at least the following session. The goal is to explore a slower operational approach than habitual intraday scalping and reduce reliance on repeated same-day round trips.
The indicator exposes both the raw measurements and combined SMI conditions, allowing users to test different ideas such as:
Distance from Local Low below 1%, 2%, 3%, 5%, etc.
Local-range proximity without SMI confirmation.
Local-range proximity combined with SMI oversold conditions.
Symmetric conditions near the local high.
Alerts are included so users can monitor multiple symbols and be notified when a new condition appears.
Experimental status
This is a research indicator, not a trading system and not a recommendation to buy or sell. The default values of 40 bars, 3%, and SMI ±40 are intentionally kept as an initial reference rather than presented as universally optimal parameters.
Community feedback is especially welcome regarding different symbols, markets, timeframes and threshold values. One of the purposes of publishing the script is to evaluate whether the observed behavior remains useful outside the instruments and historical examples used during its development.
Credits
The Stochastic Momentum Index calculation is based on the original TradingView implementation by UCSgears. The original source also credits Surjith S M for part of the overbought/oversold visualization.
This adaptation adds the local rolling-range framework, normalized distance measurements, configurable opportunity conditions, standardized local-range comparison, alerts and dashboard.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.