What it does
RSI Divergence plots the Relative Strength Index in its own window with overbought, midline and oversold levels, and automatically marks divergences between RSI and price. Each divergence gets a line joining the two RSI pivots, an arrow on the newer pivot and an optional matching line on the price chart.
Solid lines are regular divergences and dashed lines are hidden divergences. Bullish marks are green and bearish marks are red.
How it works
- RSI is read from MetaTrader's built-in RSI (Wilder smoothing) with the chosen length and applied price.
- A pivot low is a bar whose RSI is lower than each of the 5 bars before it and not higher than each of the 3 bars after it. Pivot highs are the mirror image. The pivot is only tested after the third bar to the right has closed.
- When a new pivot is confirmed, it is compared with the previous pivot of the same type if the gap is between 5 and 60 bars:
- Regular bullish: lower low in price, higher low in RSI.
- Hidden bullish: higher low in price, lower low in RSI.
- Regular bearish: higher high in price, lower high in RSI.
- Hidden bearish: lower high in price, higher high in RSI.
- Price is measured with the bar's low for pivot lows and the bar's high for pivot highs.
How to use it
- Regular bullish divergence near or below the oversold level, and regular bearish divergence near or above overbought, are the classic exhaustion patterns.
- Hidden divergences are continuation clues: in an uptrend, a hidden bullish mark during a pullback suggests momentum reset without the trend breaking.
- Wait for price to confirm, for example a close back above a minor swing high after a bullish mark, before treating it as a setup.
- Divergences on higher timeframes carry more weight than those on M1 or M5.
- The RSI Indicator lesson explains the oscillator itself.
Settings
| Input | Default | What it changes |
|---|---|---|
| RSI length | 14 | Sensitivity of the RSI line |
| Applied price | Close | Price fed into the RSI |
| Overbought / oversold level | 70 / 30 | Reference levels only; they do not filter divergences |
| Pivot bars left / right | 5 / 3 | Pivot strictness and confirmation delay |
| Minimum / maximum bars between pivots | 5 / 60 | Which pivot pairs are compared |
| Show regular / hidden | true / true | Toggle each family |
| Draw lines on the price chart | true | Mirrors each divergence on price |
| Pop-up alert / Push notification | false / false | One alert when a new divergence is confirmed |
Limitations
- Every mark is delayed by the right-hand pivot bars (3 by default). The arrow is drawn back on the pivot bar once confirmed and does not move afterwards, but it was not visible in real time at that bar.
- In strong trends RSI can stay overbought or oversold and print repeated divergences while price keeps going.
- Small pivot settings create many marks, including minor ones of little value.
- The RSI on the live bar changes with each tick.
- Divergence is an educational analysis aid, not a trade signal on its own. Trading involves substantial risk of loss.

