OPEN-SOURCE SCRIPT
RSI Divergence + Opacity

RSI + Divergences + OB/OS Opacity Fill
This indicator is a streamlined enhancement of the classic Relative Strength Index (RSI), designed to preserve the familiar TradingView RSI behavior while adding visual context for momentum extremes and potential reversals.
The script keeps the original RSI calculation and structure intact, ensuring consistent readings across all timeframes.
Features
• Standard RSI (Wilder’s RMA)
Identical calculation logic to the default TradingView RSI.
• Regular Divergence Detection
Automatically highlights:
– Bullish divergence (price lower low + RSI higher low)
– Bearish divergence (price higher high + RSI lower high)
Divergences are drawn directly on the RSI pane using minimal, unobtrusive visuals.
• Clipped Overbought / Oversold Fill
Dynamic opacity fill activates only when RSI moves beyond key levels:
– Above 70 (overbought region)
– Below 30 (oversold region)
Fill intensity increases as RSI pushes further into extremes and fades as it returns toward the threshold.
• Vertical Opacity Behavior
Color remains constant per bar; only transparency changes based on RSI distance from OB/OS levels. This avoids noisy gradients and preserves chart readability.
Design Philosophy
The goal of this script is not to reinvent RSI, but to provide clearer visual feedback for momentum conditions while keeping the indicator lightweight and predictable.
No smoothing tricks, no alternate formulas, no hidden complexity.
Notes
• Divergences use pivot-based logic and will naturally appear after pivots are confirmed.
• Like all divergence tools, signals should be interpreted within broader market context.
• Default RSI levels (70 / 30) are intentionally preserved.
This indicator is a streamlined enhancement of the classic Relative Strength Index (RSI), designed to preserve the familiar TradingView RSI behavior while adding visual context for momentum extremes and potential reversals.
The script keeps the original RSI calculation and structure intact, ensuring consistent readings across all timeframes.
Features
• Standard RSI (Wilder’s RMA)
Identical calculation logic to the default TradingView RSI.
• Regular Divergence Detection
Automatically highlights:
– Bullish divergence (price lower low + RSI higher low)
– Bearish divergence (price higher high + RSI lower high)
Divergences are drawn directly on the RSI pane using minimal, unobtrusive visuals.
• Clipped Overbought / Oversold Fill
Dynamic opacity fill activates only when RSI moves beyond key levels:
– Above 70 (overbought region)
– Below 30 (oversold region)
Fill intensity increases as RSI pushes further into extremes and fades as it returns toward the threshold.
• Vertical Opacity Behavior
Color remains constant per bar; only transparency changes based on RSI distance from OB/OS levels. This avoids noisy gradients and preserves chart readability.
Design Philosophy
The goal of this script is not to reinvent RSI, but to provide clearer visual feedback for momentum conditions while keeping the indicator lightweight and predictable.
No smoothing tricks, no alternate formulas, no hidden complexity.
Notes
• Divergences use pivot-based logic and will naturally appear after pivots are confirmed.
• Like all divergence tools, signals should be interpreted within broader market context.
• Default RSI levels (70 / 30) are intentionally preserved.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.