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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.