OPEN-SOURCE SCRIPT
Percentile Adaptive RSI | NAL

What if RSI thresholds adapted to the market's own momentum distribution, rather than remaining fixed at arbitrary levels?
Percentile Adaptive RSI is a statistically adaptive momentum framework that combines two distinct RSI measurements with dynamically estimated percentile thresholds.
Traditional RSI interpretation relies heavily on fixed reference levels, typically 30 and 70, regardless of how an asset's momentum distribution changes over time.
This model takes a different approach.
Instead of assuming that the same RSI values should carry identical significance across different market environments, it continuously evaluates momentum relative to its own recent statistical distribution.
A second RSI, calculated from a rolling price-percentile series, introduces an additional layer of momentum confirmation.
The result is a dual-RSI consensus model in which directional classifications depend on both momentum agreement and statistically adaptive thresholds.
1. Price Percentile Transformation
The first component constructs a rolling percentile estimate of the underlying price series.
Rather than directly smoothing price through a conventional moving average, the model identifies a specified quantile within the most recent observations.
Pine Script®
At the default 50th percentile, this produces a rolling median of the selected source.
The percentile parameter can be adjusted to examine different portions of the local price distribution.
This transformed price series becomes the input to a second RSI calculation.
2. Dual-RSI Momentum Structure
The framework calculates two complementary momentum measurements:
Pine Script®
The distinction is important.
The standard RSI responds directly to changes in the source, while the percentile-based RSI evaluates changes in a distribution-derived representation of price.
Comparing both measurements introduces a confirmation requirement between direct price momentum and percentile-transformed momentum.
3. Adaptive Percentile Thresholds
Conventional RSI indicators generally rely on fixed horizontal reference levels.
Percentile Adaptive RSI instead calculates its directional boundaries from the recent distribution of the standard RSI itself.
Pine Script®
These boundaries evolve as the RSI distribution changes.
For example, an upper percentile setting of 60 represents the 60th percentile of recent RSI observations, not a fixed RSI value of 60.
This allows the model to evaluate momentum relative to its recent behavior rather than relying on universal numerical levels.
4. Directional Consensus
The final directional state requires agreement between both RSI measurements.
Pine Script®
When the two components disagree or remain between the required thresholds, the model preserves its previously established directional classification.
This persistence mechanism separates isolated threshold fluctuations from changes that satisfy the complete dual-RSI condition.
Visuals & Interpretation
The oscillator provides a streamlined representation of the prevailing momentum regime.
During qualifying bullish conditions, the displayed series selects the higher of the two RSI measurements. During qualifying bearish conditions, it selects the lower measurement. When neither condition is satisfied, the plotted value remains at its previous level.
The visualization includes:
Practical Application
Percentile Adaptive RSI is designed to analyze relative momentum strength, distribution-adjusted directional conditions, and agreement between two representations of price momentum.
Its central distinction is that momentum is not evaluated against an unchanging numerical standard.
Instead, the indicator continuously asks:
Is current momentum sufficiently strong or weak relative to its recent distribution, and does that assessment remain consistent after transforming price through a rolling percentile filter?
By combining distribution-aware thresholds with dual-RSI confirmation, the model provides an alternative to conventional fixed-threshold RSI interpretation.
Automated Alerts
Two built-in alerts monitor directional state transitions:
Both alerts require confirmation of the completed bar and activate only when the directional state changes.
Configuration
Users can independently configure the source, RSI observation length, price percentile, upper and lower RSI percentile thresholds, and visual color scheme.
Percentile Adaptive RSI is a statistically adaptive momentum framework that combines two distinct RSI measurements with dynamically estimated percentile thresholds.
Traditional RSI interpretation relies heavily on fixed reference levels, typically 30 and 70, regardless of how an asset's momentum distribution changes over time.
This model takes a different approach.
Instead of assuming that the same RSI values should carry identical significance across different market environments, it continuously evaluates momentum relative to its own recent statistical distribution.
A second RSI, calculated from a rolling price-percentile series, introduces an additional layer of momentum confirmation.
The result is a dual-RSI consensus model in which directional classifications depend on both momentum agreement and statistically adaptive thresholds.
1. Price Percentile Transformation
The first component constructs a rolling percentile estimate of the underlying price series.
Rather than directly smoothing price through a conventional moving average, the model identifies a specified quantile within the most recent observations.
At the default 50th percentile, this produces a rolling median of the selected source.
The percentile parameter can be adjusted to examine different portions of the local price distribution.
This transformed price series becomes the input to a second RSI calculation.
2. Dual-RSI Momentum Structure
The framework calculates two complementary momentum measurements:
- Standard RSI — measures conventional momentum directly from the selected price source.
- Percentile RSI — measures momentum in the rolling percentile-transformed price series.
The distinction is important.
The standard RSI responds directly to changes in the source, while the percentile-based RSI evaluates changes in a distribution-derived representation of price.
Comparing both measurements introduces a confirmation requirement between direct price momentum and percentile-transformed momentum.
3. Adaptive Percentile Thresholds
Conventional RSI indicators generally rely on fixed horizontal reference levels.
Percentile Adaptive RSI instead calculates its directional boundaries from the recent distribution of the standard RSI itself.
These boundaries evolve as the RSI distribution changes.
- Upper Percentile — defines the statistical boundary for elevated momentum.
- Lower Percentile — defines the statistical boundary for subdued momentum.
For example, an upper percentile setting of 60 represents the 60th percentile of recent RSI observations, not a fixed RSI value of 60.
This allows the model to evaluate momentum relative to its recent behavior rather than relying on universal numerical levels.
4. Directional Consensus
The final directional state requires agreement between both RSI measurements.
- Bullish — both momentum measurements exceed the adaptive upper threshold.
- Bearish — both momentum measurements fall below the adaptive lower threshold.
- Transition / Disagreement — the requirements for a new directional state are not satisfied.
When the two components disagree or remain between the required thresholds, the model preserves its previously established directional classification.
This persistence mechanism separates isolated threshold fluctuations from changes that satisfy the complete dual-RSI condition.
Visuals & Interpretation
The oscillator provides a streamlined representation of the prevailing momentum regime.
During qualifying bullish conditions, the displayed series selects the higher of the two RSI measurements. During qualifying bearish conditions, it selects the lower measurement. When neither condition is satisfied, the plotted value remains at its previous level.
The visualization includes:
- A dynamically colored momentum oscillator.
- Adaptive upper and lower percentile boundaries.
- Directional gradient fills extending toward the opposing percentile boundary.
- Persistent bullish and bearish regime coloration.
- Trend-colored candles on the main chart.
- Three color presets: Standard, Nordic, and Simple.
Practical Application
Percentile Adaptive RSI is designed to analyze relative momentum strength, distribution-adjusted directional conditions, and agreement between two representations of price momentum.
Its central distinction is that momentum is not evaluated against an unchanging numerical standard.
Instead, the indicator continuously asks:
Is current momentum sufficiently strong or weak relative to its recent distribution, and does that assessment remain consistent after transforming price through a rolling percentile filter?
By combining distribution-aware thresholds with dual-RSI confirmation, the model provides an alternative to conventional fixed-threshold RSI interpretation.
Automated Alerts
Two built-in alerts monitor directional state transitions:
- Bullish Transition — triggers when the model enters a bullish regime.
- Bearish Transition — triggers when the model enters a bearish regime.
Both alerts require confirmation of the completed bar and activate only when the directional state changes.
Configuration
Users can independently configure the source, RSI observation length, price percentile, upper and lower RSI percentile thresholds, and visual color scheme.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.