OPEN-SOURCE SCRIPT
Smart RSI Divergence PRO | Auto Lines + Alerts

Smart RSI Divergence PRO
This indicator automatically finds RSI divergences on price charts:
🔹 Detects both regular & hidden divergences
🔹 Draws auto trendlines connecting swing highs & lows
🔹 Clear triangle labels directly on the chart
🔹 Ready-to-use alerts for your strategy
Use it to spot potential trend reversals and hidden continuation signals.
How it works
Regular Divergence: Price makes a higher high (or lower low) while RSI does not — this can signal a possible trend reversal.
Hidden Divergence: Price makes a lower high (or higher low) while RSI makes a higher high (or lower low) — this can signal a possible trend continuation in the same direction.
Auto Lines & Labels
The script automatically detects local swing highs and lows and draws connecting trendlines on price.
Labels appear on the chart as colored triangles, so signals are easy to see at a glance:
🔻 Red triangle — Regular Bearish Divergence (potential short)
🟠 Orange triangle — Hidden Bearish Divergence (possible trend continuation down)
🟢 Green triangle — Regular Bullish Divergence (potential long)
🔵 Blue triangle — Hidden Bullish Divergence (possible trend continuation up)
Customization
You can adjust:
RSI length
Show/hide regular or hidden divergences
Show/hide auto lines and labels
Customize line width and transparency
Works on any market and any timeframe — crypto, forex, indices, stocks.
⚠️ Disclaimer: This script is for educational purposes only and does not constitute financial advice. Always test any strategy thoroughly and trade at your own risk.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.