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 Level RSI Reversal is a mean-reversion Expert Advisor (EA) for MetaTrader 5 that combines two classic concepts — horizontal support and resistance levels with the Relative Strength Index (RSI) momentum oscillator — into a single, double-confirmation reversal system. Rather than chasing trends, it is built to fade tests of structure: it looks for the moment price pushes into a wall, fails to break through, and starts to turn back the other way. RSI, a momentum indicator that measures the speed and magnitude of recent price changes on a 0–100 scale, is used to confirm that the push into the level has actually run out of fuel.
The strategy is designed for range-bound or rotational market conditions — the kind of environment where price spends most of its time oscillating between identifiable levels rather than trending strongly in one direction. It targets liquid, range-prone major currency pairs such as EURUSD or AUDUSD on intraday timeframes. The core idea is simple but demanding: a single "buy support, sell resistance" rule gets run over on breakout days, so this EA insists that two genuinely independent signals — structure and momentum — agree on the very same closed bar before it acts.
As a learning tool, the Level RSI Reversal is well suited to traders who want to understand how confluence works in practice. It demonstrates how pivot-based support and resistance can be detected programmatically, how RSI extremes signal exhaustion, and how Average True Range (ATR) — a volatility measure — can be used to self-scale stops and entry tolerances across different symbols and timeframes. Treat it as a study in disciplined, rules-based reversal logic rather than as a shortcut of any kind.
How It Works
The strategy evaluates its rules only once per newly closed bar, never on incomplete (still-forming) candles. On each closed bar it checks for two independent conditions and only signals a trade when both align.
Structure detection (support & resistance):
- The EA scans recent price action for swing pivots. A swing high is a bar whose high stands above the highs on both sides of it (across a configurable number of bars); a swing low is the mirror image.
- From all pivots inside the lookback window, it selects the nearest level to current price: the highest swing low still below price becomes support, and the lowest swing high still above price becomes resistance.
- These are real, price-carved levels — not arbitrary round numbers.
Momentum confirmation (RSI):
- For a long setup, the strategy requires RSI to have stretched into an oversold extreme (at or below the oversold level) within the recent lookback window, and to have ticked back up on the signal bar (current RSI higher than the previous reading).
- For a short setup, RSI must have reached an overbought extreme within the window and be turning down on the signal bar.
- This captures the moment one-sided pressure into the level exhausts and momentum begins to flip.
Entry conditions — a trade signals only when both agree on the same closed bar:
- Long: the bar wicked down into support (its low reached within an ATR-based tolerance of the level) yet closed back above support, while RSI was recently oversold and is now rising. The strategy fades the dip.
- Short: the bar wicked up into resistance yet closed back below it, while RSI was recently overbought and is now falling.
- The "closed back on the correct side of the level" rule is what distinguishes a rejection from a breakout. If price closes through the level, the thesis never triggers.
Stop-loss logic:
- For longs, the stop is placed below support by a multiple of ATR (
StopAtrMult × ATR). For shorts, it sits above resistance by the same distance. The reasoning: if price travels that far beyond the rejected level, the structural idea has failed.
Take-profit logic:
- The target is a fixed reward-to-risk multiple of the stop distance (
RewardRatio). With the default 1.80 ratio, the take-profit is set 1.8 times further from entry than the stop. - Only one position per Magic number is allowed at a time. Once in a trade, the structural stop and target manage the exit. A spread filter skips signals when the current spread is wider than the configured limit.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SwingLookback | 3 | 2 | 6 | Bars required on each side of a pivot to confirm a swing high or low. |
| LevelLookback | 60 | 20 | 150 | How many recent closed bars are scanned for the nearest pivot-based level. |
| LevelTolAtr | 0.50 | 0.10 | 1.50 | Defines the "at the level" window as this multiple of ATR. |
| RsiPeriod | 14 | 7 | 28 | RSI smoothing period (number of bars used in the calculation). |
| OversoldLevel | 35.0 | 15.0 | 45.0 | RSI at or below this within the lookback marks sellers as exhausted (long context). |
| OverboughtLevel | 65.0 | 55.0 | 85.0 | RSI at or above this within the lookback marks buyers as exhausted (short context). |
| ExtremeLookback | 3 | 1 | 10 | How many recent RSI readings the extreme may have occurred within. |
| AtrPeriod | 14 | 5 | 30 | ATR period used for tolerance and stop sizing. |
| StopAtrMult | 1.00 | 0.20 | 3.00 | Stop distance beyond the rejected level, in ATR multiples. |
| RewardRatio | 1.80 | 0.80 | 4.00 | Take-profit distance as a multiple of the 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 lot size per trade. |
| Magic | 4827 | 0 | 9,999,999 | Unique identifier so the EA manages only its own positions. |

Recommended Chart Settings
The Level RSI Reversal was designed for liquid, range-prone major pairs such as EURUSD or AUDUSD on the M15 or M30 timeframe — a swing / mean-reversion style that suits markets rotating between levels. Because every tolerance and stop is scaled by ATR, the logic adapts to different volatility regimes, but that does not mean every symbol or session will behave the same way. Results will vary considerably across different market conditions, brokers, and spreads. Always study the strategy's behavior on your specific instrument and timeframe before drawing any conclusions, and revisit the parameters if you move it to a market it was not designed for.
How to Install on MetaTrader 5
- Download the
LevelRSIReversal.ex5file from the link below. - Copy it to your MT5
MQL5\Expertsfolder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Drag the EA onto a chart matching the recommended symbol and timeframe.
- Configure the input parameters and enable Algo Trading.
What to Consider Before Using This EA
The central strength of this approach is its insistence on confluence. By demanding both a structural rejection and an exhausted-then-turning RSI on the same closed bar, it throws away many of the false breaks that wreck naive level-fading systems. The ATR-based, self-scaling risk model is another genuine plus: stops and tolerances adjust to volatility rather than being hard-coded in pips, which makes the logic more portable across symbols.
That said, this style has well-known limitations. Mean-reversion systems are, by definition, fighting price at moments of strength, so they tend to underperform during strong, sustained trends — the open-ended trend days when price simply blows through level after level. RSI extremes can persist far longer than expected in a trending market, and a level that "rejects" once may give way on the next test. The reward ratio also matters: a setting above 1:1 means winners are larger than losers, but the trade-off is typically a lower hit rate, which can produce uncomfortable strings of consecutive losses. The single-position-per-Magic rule keeps risk contained but also means the EA may sit idle through opportunities it cannot act on. None of this makes the strategy good or bad — it simply defines the conditions under which it is more or less likely to behave as intended.
Risk Management Tips
- Use a demo account first. Run the EA in a risk-free simulated environment until you fully understand how and when it places trades.
- Size positions conservatively. A common educational guideline is to risk no more than 1–2% of account equity on any single trade. The fixed
Lotsinput does not automatically scale to your balance, so calculate position size relative to the ATR-based stop distance yourself. - Understand drawdown. Even a sound strategy will experience losing streaks. Know the maximum drawdown you are emotionally and financially prepared to tolerate before you commit real capital.
- Account for costs. Spreads, commissions, and slippage all erode results, especially on shorter timeframes. The spread filter helps, but it does not eliminate trading costs.
- Avoid over-optimization. Tuning parameters until a backtest looks perfect (curve-fitting) rarely survives in live markets. Favor robust settings that perform reasonably across a range of conditions.
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
- Expert Advisor: LevelRSIReversal.ex5 (3 downloads)
- Source Code: LevelRSIReversal.mq5 (3 downloads)
- Documentation: LevelRSIReversal.pdf (4 downloads)