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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.