New: the Top 10 Non-Repainting MT4 Indicator Pack is free to download

92 free indicators for MetaTrader 4 & 5

RSI Divergence Indicator MT4

Free RSI divergence indicator for MT4. Finds regular and hidden divergence between confirmed swings with lines, arrows and alerts. Settings and install guide. Free download, link emailed in seconds.

MT4Non-repaintingSignal & Arrow
Data Windowrsi-divergence-indicator-mt4
PlatformMT4 Build 600+
File.mq4 / .ex4 in .zip
Version1.0
Size5.8 KB
RepaintsNo
TypeSignal & Arrow
UpdatedNov 22, 2026
DownloadsNew listing
Download free (5.8 KB)
  • Enter your email, the download link arrives in seconds
  • Free bonus reports on the next page

Indicators are analysis tools, not trade signals. Forex trading on margin carries a high risk of loss. Test on a demo account first.

EURUSD · H4 · previewRSI Divergence Indicator MT4 v1.0
RSI Divergence Indicator MT4 on EURUSD H4Non-repainting
How it works →
Overview

The RSI Divergence indicator for MT4 plots the Relative Strength Index in its own window and automatically finds divergence between confirmed price swings and RSI. It draws matching lines on the price chart and the RSI window, adds arrows, and can send alerts. Swings are confirmed 2 candles late by default, but once a divergence is drawn it does not move or disappear.

Spotting divergence by eye is slow and subjective. This free tool applies the same clear rules to every swing, so you can review past signals honestly and get notified of new ones.

What Is the RSI Divergence Indicator?

Divergence happens when price and momentum disagree. If price makes a lower low but RSI makes a higher low, selling momentum is weakening even though price is still falling. That is regular bullish divergence, a common early warning of a possible bounce or reversal. The mirror image, a higher high in price with a lower high in RSI, is regular bearish divergence.

Hidden divergence points the other way. In an uptrend, price makes a higher low while RSI makes a lower low, which suggests the pullback was deep in momentum terms but the trend structure held. Many traders read hidden divergence as a possible continuation signal. This indicator can show both types.

How the Indicator Is Calculated

RSI

The RSI line is MetaTrader’s standard RSI with your chosen period (14) and applied price (close), plotted from 0 to 100 with level lines at 70 and 30.

Swing highs and lows

Swings are found on price, not on RSI. A candle is a swing low when its low is lower than the lows of the PivotStrength candles after it and no higher than the lows of the PivotStrength candles before it. With the default of 2, that means a five-candle pattern with the lowest low in the middle. Swing highs use the same rule with highs. If two neighboring candles share the same extreme, only the newer one counts, so a flat double bottom is marked once.

A swing can only be confirmed once the candles after it have closed. With PivotStrength 2, a swing low is confirmed when the second candle after it closes. The live candle is never used.

Comparing swings

Each time a swing low is confirmed, the code looks back for the nearest earlier swing low that is at least MinSwingDistance (5) and at most MaxSwingDistance (60) bars older. It then compares the lows of the two candles and the RSI values on those same two candles:

Type Price RSI
Regular bullish Lower low Higher value
Hidden bullish Higher low Lower value
Regular bearish Higher high Lower value
Hidden bearish Lower high Higher value

Swing highs are handled the same way for the bearish types.

What gets drawn

  • A line on the price chart from the older swing to the newer swing, and a matching line in the RSI window between the RSI values on those candles. Regular divergence uses solid lines, hidden divergence uses dotted lines.
  • An arrow on the confirmation candle, the candle that closed and confirmed the newer swing, both on the price chart and in the RSI window. Up arrows are bullish, down arrows are bearish.

Placing the arrow on the confirmation candle rather than on the swing itself shows where the signal actually became available. That keeps historical charts honest when you scroll back.

Key Features

  • Regular and optional hidden divergence, each with its own color.
  • Lines on both the price chart and the RSI window, plus arrows in both.
  • Adjustable swing strength and minimum and maximum distance between swings.
  • Only closed candles are used, so signals never appear and then vanish.
  • Alerts, sound and mobile push once per candle when a new divergence is confirmed.
  • History scan limited by MaxBarsBack to keep the terminal responsive.

How to Trade With the RSI Divergence Indicator

Divergence shows weakening momentum. It is not a timing signal by itself, and strong trends can show several divergences in a row before turning. Use it with structure and confirmation.

Regular bullish divergence

  • Best near support, at the lower edge of a range, or after an extended decline.
  • Wait for confirmation, such as a bullish engulfing candle or a break of the most recent minor high.
  • Place the stop below the newer swing low.

Regular bearish divergence

  • Best near resistance or after an extended rally, ideally with RSI coming down from above 70.
  • Confirm with a bearish candle pattern or a break of the latest minor low, and stop above the newer swing high.

Hidden divergence

Turn on ShowHidden and use it only in the direction of the larger trend: hidden bullish in uptrends, hidden bearish in downtrends. A trend filter such as the Rainbow EMA indicator or the slow line of the 3 EMA Crossover indicator helps you stay on the right side.

Candle patterns such as those found by the Engulfing Pattern indicator are a common way to confirm. Size each trade from the stop distance with the position size calculator.

Best Settings

  • PivotStrength 2: the default, quick confirmation with more swings detected.
  • PivotStrength 3 to 5: fewer, more significant swings, but each signal arrives later.
  • MinSwingDistance 5, MaxSwingDistance 60: suits H1 to D1. On M5 and M15, a smaller maximum such as 30 to 40 keeps comparisons within the same market phase.
  • RsiPeriod 14: the standard. Shorter periods produce more divergences, many of them minor.

Does It Repaint?

No, but it is delayed, and it is worth being exact about how. A swing cannot be known until the candles after it have closed, so with PivotStrength 2 every divergence appears two candles after the swing it is based on. At that moment the lines are drawn back to the two swing candles and the arrow is placed on the confirmation candle. From then on nothing changes: all the highs, lows and RSI values involved come from closed candles, so the drawing never moves, recolors or disappears. Reloading the chart rebuilds the same signals. Indicators that mark swings on the live candle often look better on history but redraw in real time. See what repainting is for the difference.

How to Install

Copy “rsi-divergence-indicator-mt4.mq4” to File > Open Data Folder > MQL4 > Indicators, restart MT4 or refresh the Navigator, and drag it onto a chart. It opens in a separate window under price. See how to install indicators in MT4 for details.

Related Indicators

Divergence can persist for a long time in strong trends, and no oscillator signal is reliable on its own. Trading on margin carries a high level of risk, so test any divergence approach on a demo account first.

RSI Divergence Indicator MT4 on an EURUSD H4 MT4 chart

RSI Divergence Indicator MT4 on a MetaTrader chart. Click to enlarge.

Repaint verdict: does not repaint. We read the source: every value is calculated on closed bars and never rewritten, so what you see in history is what you would have seen live.

Free pack

Get the Top 10 Non-Repainting Indicator Pack

Ten MT4 indicators that draw on closed bars only, in one zip with install notes for each.

Settings

Inputs, defaults and what they change

  • RsiPeriod (default 14) — RSI period.
  • RsiPrice (default PRICE_CLOSE) — Applied price for the RSI.
  • UpperLevel (default 70.0) — Upper level line in the RSI window.
  • LowerLevel (default 30.0) — Lower level line in the RSI window.
  • PivotStrength (default 2) — How many candles on each side a swing high or low must beat. Also the number of closed candles needed to confirm a swing.
  • MinSwingDistance (default 5) — Minimum number of bars between the two swings that are compared. Closer swings are skipped.
  • MaxSwingDistance (default 60) — Maximum number of bars between the two swings.
  • ShowRegular (default true) — Detect regular divergence (possible reversal).
  • ShowHidden (default false) — Detect hidden divergence (possible trend continuation).
  • MaxBarsBack (default 1000) — How many bars of history are scanned when the indicator loads.
  • DrawPriceLines (default true) — Draw divergence lines on the price chart.
  • DrawRsiLines (default true) — Draw divergence lines in the RSI window.
  • DrawPriceArrows (default true) — Draw arrows on the price chart.
  • RsiColor (default clrDodgerBlue) — RSI line color.
  • BullColor (default clrLime) — Regular bullish divergence color.
  • BearColor (default clrRed) — Regular bearish divergence color.
  • HiddenBullColor (default clrAqua) — Hidden bullish divergence color.
  • HiddenBearColor (default clrOrange) — Hidden bearish divergence color.
  • AlertsOn (default false) — Pop-up alert when a new divergence is confirmed.
  • PushOn (default false) — Push notification to the MT4 mobile app.
  • SoundOn (default false) — Play a sound on a new divergence.
  • SoundFile (default alert.wav) — Sound file from the terminal Sounds folder.
Install

How to install it in MetaTrader 4

  1. Step 1Download and unzip

    Enter your email, open the download link we send you and extract the .mq4 / .ex4 file from the zip.

  2. Step 2Open the data folder

    In MetaTrader, go to File → Open Data Folder.

  3. Step 3Copy into Indicators

    Place the file in MQL4 → Indicators, then restart MetaTrader or refresh the Navigator panel.

  4. Step 4Attach it to a chart

    Find it under Navigator → Indicators and drag it onto any chart.

First time installing an indicator? Watch the 75-second video or follow the screenshots in our MT4 install guide: every click in MetaTrader, plus fixes for an indicator that won't show up.

Free forex calculators
FAQ

RSI Divergence Indicator MT4 questions

RSI divergence is a disagreement between price and the RSI. A lower low in price with a higher low in RSI is bullish divergence, and a higher high in price with a lower high in RSI is bearish divergence. Both suggest momentum is fading.

Regular divergence warns of a possible reversal. Hidden divergence is read as a possible trend continuation: in an uptrend, price makes a higher low while RSI makes a lower low. This indicator shows regular divergence by default and hidden divergence when ShowHidden is on.

No. It only uses closed candles, so a drawn divergence never moves or disappears. It is delayed, though: a swing is confirmed PivotStrength candles later, two by default, so signals appear two candles after the swing.

RSI 14 is the standard and works well for divergence on H1 and higher. Shorter periods show more divergences, many of them minor. A higher PivotStrength filters out small swings at the cost of later signals.

It is a useful warning, not a guarantee. In strong trends RSI can diverge several times before price turns. Traders usually wait for confirmation, such as a reversal candle or a structure break, and trade near key levels.

Divergence tends to be more meaningful on H1, H4 and daily charts, where swings reflect larger moves. It works on lower timeframes too, but expect more signals and more failures.

RSI Divergence Indicator MT4
Size
5.8 KB
Version
1.0
Repaints
No
Download free
Free packTop 10 Non-Repainting Indicators

Ten closed-bar MT4 indicators in one zip.

Get the pack

RSI Divergence Indicator MT4Free · 5.8 KB

Download

Where should we email your download link?

Use an email you can check right now: the download link goes straight to this inbox.