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.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.