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. קרא עוד ב־תנאי השימוש.