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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。