You build an RSI Expert Advisor in MT5 without coding by placing four kinds of block on a canvas. A Start node, an RSI indicator, a condition that compares the RSI value to a level, and an order block. The server then generates and compiles the MQL5 for you. It takes about fifteen minutes, and no MQL5 syntax at any point.
The harder question is what you have when you are done. This guide builds the EA and then reads the Builder’s own record of the same design, which is less flattering than any tutorial will tell you.
What you’ll build
A single-position EA on one pair that buys when RSI drops below an oversold level and sells when it rises above an overbought one, with a fixed stop and target, compiled to a real .ex5 you can drop into MetaTrader 5. Eight blocks. No code.
That is the mechanical half, and it is genuinely easy. The rest of this page is the half that decides whether the file is worth running.
Before you start: what RSI measures, and what it does not
You need a free account with a verified email address (designing is free and needs no sign-in; compiling to .ex5 does), about fifteen minutes, and a MetaTrader 5 terminal to test the result in.
RSI reports where the last n closes sit between their own recent gains and losses, on a 0–100 scale. In this recipe it is doing exactly one job: saying that price has moved far and fast in one direction relative to its own recent behaviour. What it is not saying is that the move is over. That distinction is the whole risk of the strategy — an oversold reading in a downtrend is a description of the downtrend, not a signal against it.
The Builder’s RSI block exposes these settings, and the defaults are the conventional ones:
| Block setting | Default | What it controls |
|---|---|---|
period | 14 | How many bars the calculation looks back. Range 1–999 |
applied_price | PRICE_CLOSE | Which price of each bar feeds the calculation |
shift | 0 | Which bar to read — 0 is the forming bar, 1 the last closed one |
timeframe | current chart | Any of M1 through MN1, read independently of the chart |
symbol | current chart | Blank means the chart’s own symbol |
The timeframe row is the one worth noticing early. The block can read RSI from a higher timeframe than the chart it trades on. That is how a multi-timeframe filter gets built without writing code.
Step-by-step: build the RSI EA in the Builder
- Open the EA Builder and either load the
rsi_reversaltemplate from the gallery or start from a blank canvas. Loading the template is faster; building it yourself is how you learn which wire does what. - Place a Start node from the Utility palette. A flow without one fails validation with
EAB-E202before it will generate anything. - Add the RSI indicator block and set
period. Leave it at 14 for the first build so your result is comparable to the baseline below, and setshiftto 1 if you want the rule evaluated on closed bars only. - Add a Compare condition and wire the RSI block into it. This step is not optional plumbing: wiring an indicator straight into an order block is rejected with
EAB-E205— “insert a condition node (Compare/Cross) in between” — precisely because a raw indicator value is not a decision. - Set the comparison. Buy side: RSI less than 30. Sell side: RSI greater than 70. The Compare block’s own default operator is
>, so the buy branch is the one you have to remember to flip. - Wire each condition into its own Open Buy / Open Sell action block.
- Set the risk in the Settings tab — Money Management and Exit Strategy. The shared defaults are a 50-pip stop-loss, a 100-pip target and a fixed
0.01lot. A flow with no valid stop raises aCRITICALpreflight diagnosis and makes you confirm before it will build. - Press Measure to run the built-in approximate backtest, and read it against the bar the panel prints: profit factor at least 1.2, at least 60 trades, drawdown no worse than 20%.
- Press Compile .ex5, move the downloaded file into
MQL5/Expertsvia File > Open Data Folder, and refresh the Navigator. Then test it properly in the Strategy Tester before it goes anywhere near an account.
- Start node
- RSI indicator, period 14
- Compare — RSI below the oversold level
- Compare — RSI above the overbought level
- Open Buy
- Open Sell
- Stop-loss and take-profit
- Compile to .ex5
Two blocks that beginners reach for, and should not, yet.
Cross asks whether one line crossed another on this bar. That is a stricter and different question from “is below”. Used here, it would fire only on the bar RSI dips through 30 — not on every bar it stays there.
The palette also carries an RSI Divergence condition block. It detects price making a new extreme while RSI does not, and defaults to level 30, pivot_bars 70 and near_band 10. It needs an RSI block with shift set to 1 wired into it. That is a genuinely different strategy, not a tuning of this one.
RSI entry, exit and parameter settings
Here is every value this recipe exposes, and what moving it actually does.
| Setting | Template value | What moving it does |
|---|---|---|
RSI period | 14 | Shorter reacts faster and fires far more often; longer smooths and fires rarely. It changes the trade count more than the win rate |
| Oversold level | 30 | Lower is stricter — fewer, deeper entries. The template’s identity lives here |
| Overbought level | 70 | Mirror of the above on the sell side |
shift | 0 | Set to 1 to decide on closed bars only. On M5 this is the difference between a handful of decisions an hour and hundreds |
| Stop-loss | 50 pips (shared default) | The searched range was 20–50 |
| Take-profit | 100 pips (shared default) | The searched range was 20–100 |
| Lot size | 0.01 fixed | Not a strategy setting; it scales whatever the strategy does, including the losses |
The sensitivity question everyone asks, answered honestly. “Should I widen 30/70 to 20/80?” is the first thing every RSI tutorial suggests, and this page cannot tell you, because the recorded search on this template never varied the levels. What it varied was the stop and the target — SL20-50 × TP20-100, 12 combinations across three windows on H1 — and the verdict was no_robust_edge with a best in-sample profit factor of 0.91. So the levels remain an untested hypothesis here, and the settings that were tested could not lift the design to break-even from any direction. Anyone quoting a “best” RSI level to you is quoting a belief.
Backtest the RSI EA
This is the Builder’s own measured record for this template, not a re-run. Every template in the comparison below shares the single set of conditions in the table that follows it. How we test states the standard those records are held to.
rsi_reversal baseline | Value |
|---|---|
| Profit factor | 0.94 |
| Trades | 682 |
| Max drawdown | -0.97% |
| Net | -51.37 |
| Flagged weak by the manifest | yes |
| Listed as recommended in the gallery | yes |
| Clears the Measure panel’s own pass bar | no |
| Test conditions | |
|---|---|
| Experiment ID | EXP-RSI-RECIPE-BASELINE-001 |
| Parent experiment | EXP-BUILDER-TEMPLATE-BASELINE-001 |
| Symbol / timeframe | USDJPYm M5 |
| Period | 2025-06-01 – 2026-06-09 |
| Model | M1 OHLC (Model=1) |
| Deposit | 10,000 |
| Environment | Exness MT5 |
| Baseline measured | 2026-06-18 |
| Last verified | 2026-08-25 |
Read that table with the last two rows together. The gallery marks this template recommended and the manifest marks it weak, and both flags are correct about different things: it is a clean, well-formed example of the pattern, and it lost money. Across the 53 templates carrying a measured baseline, 40 are marked recommended and all 53 are flagged weak. “Recommended” is a statement about the wiring, never about the edge.
Where RSI sits among its neighbours. These eight designs were all measured under the one conditions block above, which is the only reason it is fair to line them up:
| Template | Blocks | Profit factor | Drawdown | Trades |
|---|---|---|---|---|
ma_distance_pullback | 6 | 1.10 | -0.26% | 159 |
envelope_reversal | 10 | 0.95 | -1.16% | 989 |
cci_level | 7 | 0.95 | -0.94% | 789 |
rsi_reversal | 8 | 0.94 | -0.97% | 682 |
bb_bounce | 9 | 0.92 | -0.98% | 616 |
stoch_bb | 14 | 0.90 | -1.41% | 888 |
hl_range_reversal | 8 | 0.90 | -1.33% | 573 |
mfi_stddev_revert | 12 | 0.80 | -1.66% | 362 |
Exactly one cleared 1.0, and it is the one that does not fight the trend. ma_distance_pullback buys a pullback while the trend is still intact. That is mean reversion inside a direction rather than against it. It is also the smallest design in the group, at six blocks. Every pure “price went too far, so reverse” template, RSI included, closed below break-even.
That is the strongest argument on this page for putting a trend filter in front of an RSI entry. Its limit is worth stating plainly, though. It took 159 trades against RSI’s 682, so it bought that result with selectivity — and a quarter of the sample is a weaker claim, not a stronger one.
Common mistakes to avoid
Reading “oversold” as “about to turn.” This is the failure mode specific to this indicator, and it is why the pure reversal templates cluster below 1.0. In a sustained move, RSI sits pinned at an extreme for a long time and the rule fires again and again into a trend that is not finished. The stop is what ends each of those trades, which is why widening it makes this particular design worse rather than safer.
Compiling the template and calling it done. It carries a recommended badge and a losing record simultaneously. The badge is about the wiring.
Tuning until the backtest looks good. The recorded search here already did that honestly — 12 combinations, three windows — and reported no_robust_edge. If your own tuning produces a winner where a systematic search did not, suspect the tuning before you believe the winner. That is what overfitting looks like from the inside.
Adding pairs to smooth the equity curve. The two-pair basket is in the table above: 37 times the drawdown of the single-pair version.
Trusting an M5 result built on interpolated bars. The baseline uses the M1 OHLC model, so intra-bar movement is simulated rather than real. For a rule that trades inside the day, that is the coarse end of trustworthy — re-run anything promising on real tick data in MT5’s own tester.
Running it beside another EA without separating them. Each EA on one account needs its own magic number, or one EA’s exit logic closes the other’s positions.
Next steps and variations
When not to use RSI at all. In a strongly trending market, an unfiltered RSI reversal is a machine for selling strength and buying weakness. If you cannot state a condition that switches the rule off during trends, the honest options are to use a trend filter or to use a different idea — mean reversion explains which market conditions the family needs, and what it costs when they are absent.
The variations worth trying, in order of evidence. Add a higher-timeframe direction filter first, since the one design in the neighbourhood that cleared 1.0 is the one that requires the trend intact — the RSI block’s own timeframe setting does this without any code. Then try the RSI Divergence condition block, which asks a different and stricter question than a level cross. Only after that touch the levels, and change one at a time.
Then test it properly. The Measure panel is a filter, not a verdict: it is bar-level and approximate. How to run a backtest in MT5 walks a real run end to end, including which of the report’s two drawdown numbers to believe, and the rest of the backtesting guides cover the optimisation and walk-forward steps that come after. How to build a MACD EA is the sibling recipe with the opposite failure mode — its search did find a winning setting out of sample, which is a more dangerous result than never finding one. How to create an MT5 EA without coding is the wider tour of the block vocabulary if this recipe was your first flow.
And if you want to see what a documented record looks like, the published EAs each carry a complete closed-trade list and a run manifest. Comparing one of those against the table above is the fastest way to calibrate what “measured” should mean before you trust any strategy, including your own.