RSI Divergence Swing Strategy is a structure-based reversal strategy: it does not trade RSI extremes on their own, it compares two confirmed swing pivots and only acts when price and RSI disagree about which one was the stronger move. This page covers the exact entry and exit rules, a real Strategy Tester run of those rules on XAUUSD H1, how the stop and time-stop scale across other pairs and timeframes, and where the rules break down.
For more like this, browse the forex strategy hub.
Strategy overview

RSI Divergence Swing Strategy trades XAUUSD on the H1 chart. Gold moves in dollars, not pips. Size positions accordingly.
Both pivots must be confirmed swing points, not just any two RSI readings. That confirmation step (PivotLookback bars on each side) is slower than a simple oversold/overbought bounce, which is the point – it filters out the far more common case of RSI just dipping and recovering inside a normal swing.
Tools used
- RSI (14) for divergence detection
- Swing pivots (5-bar) on the price chart
- Prior swing highs and lows for targets
- MT4 and MT5 for chart, alerts, and order placement.
Entry rules

Long entry:
- Wait for price to print a lower low at a swing pivot.
- Check RSI (14): it must print a higher low, with the first RSI low under 40. That is the bullish divergence.
- The trigger is a close above the high of the bar that made the second price low.
- Enter at the open of the next bar. The indicator prints a spring-green arrow under the divergence low.
Short entry: Price prints a higher high while RSI prints a lower high from above 60, and a close breaks the trigger bar’s low. The indicator prints a hot-pink arrow above the bar.
Exit rules

- First target. The prior swing high — the level that started the falling leg. Divergence trades aim at the other side of the swing.
- Stop loss. Place the stop below the divergence low. On XAUUSD H1 that usually lands $3–$7 out.
- Time stop. Divergence setups resolve slowly. Give the trade 20 closed bars; then exit at market.
Filters that improve the setup
- Skip divergences that form inside a tight range. The pattern needs a real falling leg behind it.
- The indicator waits at least 5 bars between signals, so overlapping divergences do not stack.
- Trade the London–NY overlap, when spreads are tight and flow is two-sided.
- Skip red-folder news for the pair’s currencies. News lows break divergence structure routinely.
Worked example
- Price makes a lower low. RSI holds a higher low from under 40 — the divergence is on the chart.
- A bar closes above the trigger level and the indicator prints a spring-green arrow.
- The stop sits below the divergence low — on XAUUSD H1, typically $3–$7 from entry.
- The first target is the prior swing high. Take partial profit there and trail the rest.
These numbers are illustrative. They are not a forecast and they are not a promise.
Indicator settings

The download ships with these defaults. Every input is adjustable from the indicator’s settings panel.
| Input | Default | Purpose |
|---|---|---|
| RsiPeriod | 14 | RSI length for divergence detection |
| PivotLookback | 5 | Bars each side that define a swing pivot |
| MaxBarsBetweenLows | 30 | Maximum distance between the two divergence lows |
| OversoldRef / OverboughtRef | 40 / 60 | RSI zones the first pivot must come from |
| ConfirmBreak | true | Require the trigger-bar break before the arrow prints |
| MinBarsBetween | 5 | Cooldown bars between signals |
How the rules adapt across pairs and timeframes
The entry and exit logic above does not change from market to market – only the stop distance and the time-stop window scale with each instrument’s own volatility. These are the real per-market figures the rule set uses, not a single copied number:
| Pair | Timeframe | Typical stop | Time-stop window |
|---|---|---|---|
| XAUUSD | H1 | $3–$7 | about half a trading day |
| EURUSD | M15 | 8–18 pips | about two and a half hours |
| XAUUSD | H4 | $7–$15 | about two trading days |
| USDJPY | M15 | 8–18 pips | about two and a half hours |
Backtest results
We coded the exact entry, exit, filter and time-stop rules above into a rules-testing Expert Advisor (rsi_divergence_swing_backtest_ea.mq4 – not the download package above, which only draws signals) and ran it through the MT4 Strategy Tester on XAUUSD H1, open-price model, fixed 0.01 lots, a $10,000 starting balance, magic-number isolated from any other order. The broker’s own history for this symbol and timeframe covered 2026.03.23 12:00 to 2026.08.18 23:59.
Over that window the rules produced 29 trades, 62% of them profitable, for a net loss of $-5.76 (gross profit $+342.49, gross loss $-348.25, profit factor 0.98). Maximum drawdown over the run was 1.82% of the test balance.
29 trades is a small sample – not enough to draw a firm conclusion about the rules’ long-run edge, only enough to show the exact logic above actually executes as described against real historical price data rather than a hand-picked chart example. Test the rules yourself over a longer window and on your own broker’s feed before risking capital. Results are not guaranteed; past performance is not indicative of future results.
Where this strategy fails
- Divergence setups are rare by construction, so this strategy trades far less often than a momentum or crossover system on the same chart – patience is part of the rule set, not a side effect.
- A divergence can keep extending: price can make a third, even lower low while RSI keeps printing higher lows, and the strategy’s first signal is not protected against that continuation beyond the stop.
- The prior-swing target can sit a long way from entry on a wide swing, which stretches the time-to-target and means the position is exposed to unrelated news for longer than a scalp or crossover trade would be.
How this page was verified
The signal indicator behind the download is our own build, compiled for MT4 and MT5 and checked on live charts before release; it draws signals once per closed bar and does not repaint. The Backtest results section above verifies the underlying rule logic separately, against real historical price data, not against the indicator’s chart output.
Download the RSI Divergence Swing Strategy template
Download the complete RSI Divergence Swing Strategy package for MT4 and MT5 below. The zip contains the compiled signal indicator for both platforms, a ready chart template for each, a STRATEGY-RULES.txt file with the exact rule list, and a README with install steps.
Download this strategy free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
You will receive the package by email after a one-step confirmation. If you are new to MetaTrader, follow the step-by-step MT4 and MT5 indicator install guide to load the indicator and the chart template.
FAQ
Why is this a rsi divergence swing strategy, not just a generic setup?
A structure-based reversal strategy: it does not trade RSI extremes on their own, it compares two confirmed swing pivots and only acts when price and RSI disagree about which one was the stronger move.
How many trades did the real backtest produce?
On XAUUSD H1, the rules-testing EA logged 29 trades over 2026.03.23 to 2026.08.18 – see the Backtest results section above for the full numbers.
Why does the strategy need two pivots, not just one RSI extreme?
A single RSI extreme only says momentum is stretched. Comparing two confirmed pivots is what actually defines divergence – price making a new extreme while RSI does not confirm it is a structural disagreement, not just a stretched reading.
What does MaxBarsBetweenLows actually protect against?
It caps how far apart the two pivots can sit. Two price lows separated by months on a swing chart are not really the same move any more, so comparing their RSI values would not describe a real divergence – the cap keeps the comparison meaningful.
Can I run this on a different pair or timeframe than shown here?
Yes – the settings-by-pair/timeframe table above shows how the stop distance and time-stop window change across a few real combinations. The core rules (the indicator settings table) stay the same; only the distances scale with the instrument’s own volatility.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed. Past performance is not indicative of future results. This rsi divergence swing strategy is a rule-based framework, not a signal service; test it and adapt it to your own risk tolerance before using live capital.
Related on forexmt4systems.com: RSI Divergence Swing Strategy for XAUUSD on H4 · RSI Divergence Swing Strategy for XAUUSD on M15 · Rsi Tma Centered Bands Indicator MT4 + MT5.
Authoritative references
- Learn more about the Relative Strength Index (RSI).
- General background on technical indicators.
