OPEN-SOURCE SCRIPT
已更新 RSI Median Deviation

RSI Median Deviation
Thank you to QuantumResearch for part of the code and inspiration!
Introduction:
With my first published indicator i wanted to start simple, so i created a RSI that has no static OB/OS signals and can act as a Momentum-Strength-Gauge.
Inspiration came from the Median Deviation Bands indicator by QuantumResearch!
TL;DR:
Traditional RSI says "70 is overbought" like it's a universal law. Guess what: it's not.
This indicator figures out where overbought and oversold actually are for your specific chart and timeframe, using real statistics.
What Makes it Different
Most RSI indicators slap horizontal lines at 70/30 and call it a day. Problem is, that works great... until it doesn't. In a strong trend, RSI can camp out above 70 for weeks. In choppy markets, it'll ping-pong across those levels.
RSI Median Deviation takes a smarter approach:
1. Adaptive zones that move with your data
2. Median + standard deviation bands (the 50th percentile ±2σ) that show where RSI is statistically extreme
3. Rare signals that actually mean something
4. Optional smoothed bands that adapt to current market conditions in real-time
Think of it like this: instead of asking "is RSI above 70?", we're asking "is RSI acting weird compared to its recent behavior?"
Key Features
- Statistical bands built from the RSI's actual median and standard deviation
- Multiple MA options (TEMA, WMA, HMA, ALMA, etc.) for smoothing.
- Dual detection modes: Pure stats OR MA bands
- Background highlighting when something genuinely extreme happens
- Diamond markers for ultra-rare RSI readings (<25 or >85)
- 9 color themes
- Works on all timeframes
How to Actually Use This Thing
1. Trend Bias
RSI line turns green above 60 (bullish bias), red below 47 (bearish bias).

2. Mean-Reversion Plays

Dark green background = RSI dropped below the lower 2σ band → statistically oversold
Dark magenta background = RSI spiked above the upper 2σ band → statistically overbought
3. Momentum Strength Gauge
Watch the distance between the smoothed RSI and the median line:

Wide gap = strong trend in play
Converging = momentum dying, consolidation likely
4. Extra Confirmation
Those diamond shapes at the top/bottom? That's RSI hitting <25 or >85 – genuinely extreme territory.
Recommended Settings:
RSI Length: 10
Median Length: 28
SD Length: 27
RSI MA Type: TEMA
RSI MA Length: 27
Band MA Type: WMA
Band Length: 37
The standard settings are optimized to have maximum use on all assets.
Works on everything, especially on daily or 4h charts for swing/position trading.
Last words:
RSI Median Deviation is the version that only gives signals if the ROC of your data is on the extreme side.
It'll give you fewer, better signals based on what's actually happening in the markets.
Perfect for traders who'd rather have quality over quantity.
Thank you to QuantumResearch for part of the code and inspiration!
Introduction:
With my first published indicator i wanted to start simple, so i created a RSI that has no static OB/OS signals and can act as a Momentum-Strength-Gauge.
Inspiration came from the Median Deviation Bands indicator by QuantumResearch!
TL;DR:
Traditional RSI says "70 is overbought" like it's a universal law. Guess what: it's not.
This indicator figures out where overbought and oversold actually are for your specific chart and timeframe, using real statistics.
What Makes it Different
Most RSI indicators slap horizontal lines at 70/30 and call it a day. Problem is, that works great... until it doesn't. In a strong trend, RSI can camp out above 70 for weeks. In choppy markets, it'll ping-pong across those levels.
RSI Median Deviation takes a smarter approach:
1. Adaptive zones that move with your data
2. Median + standard deviation bands (the 50th percentile ±2σ) that show where RSI is statistically extreme
3. Rare signals that actually mean something
4. Optional smoothed bands that adapt to current market conditions in real-time
Think of it like this: instead of asking "is RSI above 70?", we're asking "is RSI acting weird compared to its recent behavior?"
Key Features
- Statistical bands built from the RSI's actual median and standard deviation
- Multiple MA options (TEMA, WMA, HMA, ALMA, etc.) for smoothing.
- Dual detection modes: Pure stats OR MA bands
- Background highlighting when something genuinely extreme happens
- Diamond markers for ultra-rare RSI readings (<25 or >85)
- 9 color themes
- Works on all timeframes
How to Actually Use This Thing
1. Trend Bias
RSI line turns green above 60 (bullish bias), red below 47 (bearish bias).
2. Mean-Reversion Plays
Dark green background = RSI dropped below the lower 2σ band → statistically oversold
Dark magenta background = RSI spiked above the upper 2σ band → statistically overbought
3. Momentum Strength Gauge
Watch the distance between the smoothed RSI and the median line:
Wide gap = strong trend in play
Converging = momentum dying, consolidation likely
4. Extra Confirmation
Those diamond shapes at the top/bottom? That's RSI hitting <25 or >85 – genuinely extreme territory.
Recommended Settings:
RSI Length: 10
Median Length: 28
SD Length: 27
RSI MA Type: TEMA
RSI MA Length: 27
Band MA Type: WMA
Band Length: 37
The standard settings are optimized to have maximum use on all assets.
Works on everything, especially on daily or 4h charts for swing/position trading.
Last words:
RSI Median Deviation is the version that only gives signals if the ROC of your data is on the extreme side.
It'll give you fewer, better signals based on what's actually happening in the markets.
Perfect for traders who'd rather have quality over quantity.
版本注释
- Small update to chart版本注释
- Error in the code fixed版本注释
- Another chart fix开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。