OPEN-SOURCE SCRIPT
Dynamic Range RSI [DefinedEdge]

🔍 OVERVIEW
Really excited to release this one. I've been working on this for a while and it solves something that always bugged me about RSI: the fixed lookback period. Markets don't move at one speed, so why should your oscillator?
Dynamic Range RSI rethinks the standard RSI by replacing the fixed lookback with a volatility-adaptive engine. The indicator reads the current ATR regime and automatically adjusts its period. Shorter when markets are volatile, longer when they're quiet. No manual switching, no lag when it matters.
It also layers in divergence detection and a higher-timeframe confluence ribbon so you're not trading the oscillator in isolation.
⚙️ HOW IT WORKS
The core calculation uses a range-normalized momentum formula instead of standard RSI math. Price changes are weighted by the current high-low range, which makes the output cleaner during trending moves and less prone to false signals during chop.
The adaptive length is driven by an ATR ratio (fast ATR vs slow ATR). When volatility spikes, the RSI period compresses toward the minimum. When volatility drops, it stretches toward the maximum. Responsive during breakouts, smooth during consolidation.
🎯 FEATURES
→ ATR-adaptive RSI length (user-defined min/max range)
→ Range-normalized momentum calculation
→ 4 smoothing methods: EMA, SMA, RMA, TMA
→ Automatic divergence detection (pivot-based, configurable lookback)
→ Higher-timeframe confluence ribbon (auto or manual HTF selection)
→ Signal line crossover dots filtered to OB/OS zones only
→ 6 built-in alert conditions
→ Dynamic length visible in status line
📊 SIGNALS
• Green circles: signal line cross up inside oversold zone
• Red circles: signal line cross down inside overbought zone
• "Bull" labels: bullish divergence (price lower low, RSI higher low)
• "Bear" labels: bearish divergence (price higher high, RSI lower high)
• Background shading: HTF ribbon turns green/red when the higher timeframe agrees on OB/OS
💡 USAGE TIPS
Works on any market, any timeframe. For crypto I like the 4H. The adaptive length flexes between roughly 1 to 5 days of lookback which catches momentum shifts well. For scalping, 15min with HTF pulling from 4H gives solid confluence.
If the dynamic length stays pinned at minimum too often, bump the Min Length up to 8-10 to smooth it out.
Really excited to release this one. I've been working on this for a while and it solves something that always bugged me about RSI: the fixed lookback period. Markets don't move at one speed, so why should your oscillator?
Dynamic Range RSI rethinks the standard RSI by replacing the fixed lookback with a volatility-adaptive engine. The indicator reads the current ATR regime and automatically adjusts its period. Shorter when markets are volatile, longer when they're quiet. No manual switching, no lag when it matters.
It also layers in divergence detection and a higher-timeframe confluence ribbon so you're not trading the oscillator in isolation.
⚙️ HOW IT WORKS
The core calculation uses a range-normalized momentum formula instead of standard RSI math. Price changes are weighted by the current high-low range, which makes the output cleaner during trending moves and less prone to false signals during chop.
The adaptive length is driven by an ATR ratio (fast ATR vs slow ATR). When volatility spikes, the RSI period compresses toward the minimum. When volatility drops, it stretches toward the maximum. Responsive during breakouts, smooth during consolidation.
🎯 FEATURES
→ ATR-adaptive RSI length (user-defined min/max range)
→ Range-normalized momentum calculation
→ 4 smoothing methods: EMA, SMA, RMA, TMA
→ Automatic divergence detection (pivot-based, configurable lookback)
→ Higher-timeframe confluence ribbon (auto or manual HTF selection)
→ Signal line crossover dots filtered to OB/OS zones only
→ 6 built-in alert conditions
→ Dynamic length visible in status line
📊 SIGNALS
• Green circles: signal line cross up inside oversold zone
• Red circles: signal line cross down inside overbought zone
• "Bull" labels: bullish divergence (price lower low, RSI higher low)
• "Bear" labels: bearish divergence (price higher high, RSI lower high)
• Background shading: HTF ribbon turns green/red when the higher timeframe agrees on OB/OS
💡 USAGE TIPS
Works on any market, any timeframe. For crypto I like the 4H. The adaptive length flexes between roughly 1 to 5 days of lookback which catches momentum shifts well. For scalping, 15min with HTF pulling from 4H gives solid confluence.
If the dynamic length stays pinned at minimum too often, bump the Min Length up to 8-10 to smooth it out.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。