OPEN-SOURCE SCRIPT
RSI Divergence Indicator with Custom Levels

Here's a publish-ready description you can paste into TradingView's publishing form:
---
**RSI Divergence Indicator with Custom Levels**
This indicator combines a standard RSI oscillator with automatic divergence detection, plus fully customizable horizontal reference lines.
**Core Features:**
- **RSI Oscillator** — configurable period and source, plotted with standard 30/50/70 reference lines and an overbought/oversold shaded zone.
- **Automatic Divergence Detection** — identifies and labels four types of divergence directly on the RSI:
- Regular Bullish (price makes a lower low, RSI makes a higher low)
- Hidden Bullish (price makes a higher low, RSI makes a lower low)
- Regular Bearish (price makes a higher high, RSI makes a lower high)
- Hidden Bearish (price makes a lower high, RSI makes a higher high)
- **Built-in Alerts** — alert conditions are included for all four divergence types, so you can get notified the moment a new divergence forms.
**New: Custom Horizontal Lines**
Beyond the default 30/50/70 levels, you can now add up to 10 additional horizontal reference lines anywhere on the RSI scale — useful for marking your own thresholds, historical pivot levels, or extreme readings. Each line is fully independent and configurable:
- Enable/disable individually
- Set the exact level
- Choose the color and opacity
- Choose the line style (solid, dashed, dotted)
- Set the line width
This makes it easy to tailor the indicator to your own trading strategy without cluttering the chart with lines you don't need.
**How to Use:**
Add the indicator, then open its settings to adjust RSI period/source, toggle divergence types, and turn on any custom lines you want under "Custom Line 1" through "Custom Line 10."
---
**RSI Divergence Indicator with Custom Levels**
This indicator combines a standard RSI oscillator with automatic divergence detection, plus fully customizable horizontal reference lines.
**Core Features:**
- **RSI Oscillator** — configurable period and source, plotted with standard 30/50/70 reference lines and an overbought/oversold shaded zone.
- **Automatic Divergence Detection** — identifies and labels four types of divergence directly on the RSI:
- Regular Bullish (price makes a lower low, RSI makes a higher low)
- Hidden Bullish (price makes a higher low, RSI makes a lower low)
- Regular Bearish (price makes a higher high, RSI makes a lower high)
- Hidden Bearish (price makes a lower high, RSI makes a higher high)
- **Built-in Alerts** — alert conditions are included for all four divergence types, so you can get notified the moment a new divergence forms.
**New: Custom Horizontal Lines**
Beyond the default 30/50/70 levels, you can now add up to 10 additional horizontal reference lines anywhere on the RSI scale — useful for marking your own thresholds, historical pivot levels, or extreme readings. Each line is fully independent and configurable:
- Enable/disable individually
- Set the exact level
- Choose the color and opacity
- Choose the line style (solid, dashed, dotted)
- Set the line width
This makes it easy to tailor the indicator to your own trading strategy without cluttering the chart with lines you don't need.
**How to Use:**
Add the indicator, then open its settings to adjust RSI period/source, toggle divergence types, and turn on any custom lines you want under "Custom Line 1" through "Custom Line 10."
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.