Blog / Strategy
Strategy

Pivot RSI Reversion

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 Reversion strategy is a mean-reversion trading system that combines pivot points (a classic support-and-resistance framework) with the Relative Strength Index, or RSI (a momentum oscillator that measures how overstretched recent price moves have become). Mean reversion is the idea that price, after stretching too far from a central value, often snaps back toward it. This Expert Advisor (EA) for MetaTrader 5 tries to identify those overstretched "pokes" into the edge of a price band and fade them — that is, trade against the short-term move in anticipation of a bounce back toward the middle.

Rather than using the traditional "previous-day" pivot calculation, the strategy builds a rolling pivot ladder. On every newly closed bar it looks back over a configurable window of completed bars, finds the highest high and lowest low, and recomputes a central pivot (P) along with two support lines (S1, S2) and two resistance lines (R1, R2). Because it only ever reads bars that have already closed, the calculation is non-repainting — the levels do not shift around after the fact, which makes the logic honest and reproducible in backtests.

This is best understood as a learning tool for studying how support/resistance and momentum filters can be combined into a single disciplined rule set. It is designed for range-bound or choppy market conditions, where price oscillates between bands rather than trending strongly in one direction. It suits traders who want to study confluence-based entries, structural stop placement, and reward-to-risk filtering — not those looking for a hands-off shortcut.

How It Works

The strategy evaluates its rules once per newly closed bar and holds at most one position at a time per magic number. Here is the full logic in plain English.

Building the pivot ladder (every closed bar):

Long (buy) entry — the strategy signals a long when all of these are true:

Short (sell) entry — the strategy signals a short when all of these are true:

Stop-loss logic:

Take-profit logic:

Additional filters before any trade is placed:

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

Strategy Parameters

Parameter Default Min Max Description
PivotLookback 20 10 60 Number of closed bars used to build the rolling pivot ladder (highest high / lowest low window).
RsiPeriod 14 7 28 Lookback length for the RSI momentum oscillator.
RsiOversold 35 15 45 A long entry requires RSI to be below this level (momentum stretched down).
RsiOverbought 65 55 85 A short entry requires RSI to be above this level (momentum stretched up).
AtrPeriod 14 7 28 Lookback length for the ATR volatility measure used to size the stop buffer.
AtrStopMult 1.00 0.20 3.00 ATR multiple added beyond the structural stop level (S2/low or R2/high).
MinRewardRisk 1.00 0.30 3.00 Minimum acceptable reward:risk ratio (target distance ÷ stop distance) for a trade to be taken.
MaxSpreadPoints 100 5 300 Skip new entries when the current spread (in points) is wider than this.
Lots 0.10 0.01 1.00 Fixed trade volume in lots.
Magic 7401 0 9,999,999 Unique EA identifier so it manages only its own positions.
pivot RSI mean reversion EA — MQL5 source code

Recommended Chart Settings

This strategy was designed around a liquid FX major such as EURUSD on the M15 (15-minute) timeframe. Liquid majors tend to have tight spreads, which helps the spread gate and keeps the cost of fading short-term moves manageable. The M15 timeframe offers a balance between signal frequency and noise.

That said, because every distance in the strategy scales with ATR and the rolling range, the rules are intended to be symbol- and volatility-agnostic and can be studied across other instruments and timeframes. Keep in mind that results will vary considerably across different market conditions — a setting that behaves one way in a quiet range may behave very differently in a strong trend or during a news-driven spike.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of this approach. The Pivot Rsi Reversion logic is built on confluence: it requires both a structural rejection at a pivot band and a stretched RSI reading before acting. This double filter is designed to keep the strategy out of the many false signals a naked pivot touch would produce in a trend. The non-repainting rolling pivots make it honest to backtest, the ATR-scaled stop adapts to volatility, and the explicit reward:risk filter discards setups where the target is too close to justify the risk.

Known limitations. Mean-reversion strategies share a structural weakness: they fade moves, which means they are, by design, trading against momentum. In a strong, sustained trend, support and resistance bands get broken repeatedly, and a fade strategy can take a series of losing trades as price runs away from the pivot. RSI thresholds can also stay "stretched" for long periods during powerful moves without reverting. The fixed Lots sizing does not adjust to account equity, and the single-position rule means missed opportunities while a trade is open.

Where it may underperform. Trending markets, breakout environments, high-impact news events, and instruments with wide or erratic spreads are all conditions where this style historically struggles. It is most at home in calmer, range-bound phases — and identifying those phases in advance is itself a challenge. Treat it as a framework to study, test, and understand rather than a finished solution.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider these general principles as part of your education:

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