Blog / Strategy
Strategy

Pivot RSI Divergence

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

The Pivot RSI Divergence strategy is a swing-trading reversal system that combines two well-established technical tools: floor pivot points (objective horizontal levels of support and resistance derived from recent price action) and RSI divergence (a momentum signal where the Relative Strength Index quietly weakens even as price pushes to a fresh high or low). The Relative Strength Index, or RSI, is a bounded oscillator that measures the speed and size of recent price moves; "divergence" simply means price and the indicator are disagreeing about whether a move still has strength behind it.

Rather than chasing breakouts or riding trends, this approach is designed to identify moments where a move may be running out of fuel right at a price level the market already respects. Pivot points map where a turn is statistically more likely to occur, while RSI divergence helps confirm whether the move that reached that level is genuinely losing momentum. Average True Range (ATR), a volatility measure, is used only to size the protective stop — not to generate signals.

As a learning tool, this strategy is best suited to traders who want to study confluence-based reversal logic — the idea that two independent conditions agreeing produces a higher-quality setup than either condition alone. It is intended for educational study of mean-reverting major currency pairs on intermediate timeframes. It is not a shortcut or a profit guarantee; it is a structured framework for understanding how momentum exhaustion and key levels can be combined into a single, rule-based system.

How It Works

The strategy maintains a rolling memory of recent swing highs and swing lows, detected using a symmetric fractal pattern. A bar is confirmed as a swing low when its low is the strict minimum of the bars on either side of it (and the mirror condition defines a swing high). Each confirmed swing stores its price and the RSI reading on that bar. The system keeps the last two swing lows and the last two swing highs so it can compare them.

Every time a new swing confirms, the strategy recalculates floor pivots from the most recent closed bars and checks for a divergence setup:

Because entries are evaluated only at the moment a new swing confirms, price has typically already begun to turn before any order is considered — the system reacts to completed structure rather than predicting it.

pivot RSI divergence MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
PivotPeriod 20 8 60 Number of recent closed bars used to build the rolling pivot reference window.
RsiPeriod 14 7 28 Smoothing period for the RSI momentum oscillator.
SwingHalf 2 1 5 Fractal half-width: bars required on each side to confirm a swing high or low.
DivMaxGap 30 6 80 Maximum number of bars allowed between the two swing extremes for a valid divergence.
PivotTolFrac 0.30 0.00 1.00 How far inside the pivot range still counts as being "at" support or resistance.
AtrPeriod 14 7 30 ATR period used to size the protective stop buffer.
StopAtrMult 0.80 0.10 3.00 Stop buffer beyond the swing extreme, expressed in ATR multiples.
RewardRatio 1.80 0.80 4.00 Take-profit distance as a multiple of the structural stop distance.
MaxSpreadPoints 30 1 200 Skip the trade if the current spread (in points) is wider than this.
Lots 0.10 0.01 1.00 Fixed order volume per trade.
Magic 4271 0 9,999,999 Unique identifier the EA uses to track its own positions.
pivot RSI divergence MT5 EA — MQL5 source code

Recommended Chart Settings

The Pivot RSI Divergence strategy was designed with a mean-reverting major currency pair in mind — for example GBPUSD or EURUSD — on the M30 or H1 timeframe, reflecting its swing-trading character. These pairs tend to oscillate within ranges often enough to give divergence-at-a-pivot setups room to play out, and the intermediate timeframes filter much of the intrabar noise that affects faster charts.

That said, every market behaves differently across time. A pair and timeframe that produced clean setups during one period may behave very differently when volatility regimes, liquidity, or trend conditions change. Treat the recommended settings as a starting point for study and forward-testing, not as a fixed configuration that will behave identically in every environment.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The core strength of this approach is its insistence on confluence. A naked RSI-divergence signal fires constantly across a chart, and many "lower-low / higher-RSI" prints happen mid-range where they mean very little — in a strong trend, such signals are routinely overrun. Likewise, a naked pivot bounce assumes every touch of support or resistance holds, which it does not. By requiring the divergence to occur at a pivot demand or supply level, the strategy keeps only the setups where weakening momentum meets a price the market has historically respected, which may help filter out lone-signal noise.

Its limitations follow directly from its design. As a reversal system, it is inherently counter-trend: in a powerful, sustained trend, divergence signals can appear repeatedly while price keeps marching against the setup, and the stop may be hit before any reversal materializes. Pivot levels themselves are statistical, not magical — they are respected often enough to be useful, but they break regularly during high-impact news and strong directional moves. The fixed reward-to-risk target also means trades may close at the target before a larger move develops, or give back unrealized gains if the market reverses before reaching it.

This EA is best understood as a study of reversal mechanics rather than a finished, hands-off solution. Its behaviour is sensitive to parameter choices such as the swing fractal width, the divergence gap limit, and the pivot tolerance, and those interactions are exactly what makes it worth examining on a demo account.

Risk Management Tips

Sound risk management matters far more than any single entry signal. As general educational principles:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog