REX·TRADING Join on Telegram

The hiring interview

How to Test an EA on MT5, and What the Result Entitles You to Believe

An Expert Advisor is a machine you hand your capital to, and the Strategy Tester is the only interview it ever sits. The clicks take ten minutes. Reading the result honestly takes arithmetic.

REX Trading Signal logo
Rex · @REXTradingSignal · 11.9K followers
How to test an ea on mt5, REX Trading Signal cover image on treating a backtest as due diligence before funding a robot

How to test an ea on mt5 is usually taught as a sequence of clicks, and the clicks take about ten minutes to learn. That is not the hard part and it never was. The hard part is knowing what the result entitles you to believe, because an Expert Advisor is a machine you are about to hand your capital to, and the Strategy Tester is the only interview it will ever sit.

Treat it the way you would treat hiring someone to work unsupervised with the company float. You would not read the CV and hand over the keys. You would check the references, run a trial, write down in advance what would make you end the trial, and keep the trial small enough that being wrong is survivable. That framing decides everything below.

What the Strategy Tester Actually Does

The MT5 Strategy Tester replays historical price data through your EA's logic and records the orders it would have placed. It is a simulation, and it is only ever as good as three things: the quality of the history it replays, the fidelity of the execution model, and the honesty of the person reading the output.

The first two are technical and improvable. The third is where accounts are lost. A tester will happily produce a beautiful equity curve for a strategy that cannot work, because you asked it to, and it has no opinion about whether your question was a good one.

How to Test an EA on MT5, in the Order That Matters

The mechanical sequence first, so it is out of the way. Open the Strategy Tester from the View menu or with Ctrl and R. Select the EA, the symbol and the timeframe. Choose a date range. Choose a modelling mode. Set the deposit and leverage to something resembling the account you would actually use. Run it, then read the report and the graph tabs.

Now the parts that decide whether the answer means anything.

Use every tick based on real ticks where your broker provides it, rather than the faster approximations. The cheaper modes interpolate what happened between the recorded points, and a strategy whose entries or stops depend on precise intrabar behaviour will look very different under interpolation than under real data. If your EA trades on the close of completed bars only, the cheaper modes are defensible. If it does anything intrabar, they are not.

Download the history first and check the quality figure. The tester reports a modelling quality percentage. A low figure is not a detail to be pushed past; it means large stretches of the period were reconstructed rather than replayed.

Set spread and commission to something pessimistic. Testing on a fixed minimum spread is the single most common way to manufacture a profitable backtest from a strategy that loses money in the market. If the edge disappears when you widen the spread by a realistic amount, the edge was never there, it was living inside the assumption.

Reserve data the EA has never seen. Test on one period, then test on a later period you did not touch while developing. If the second result looks nothing like the first, you have measured the curve fitting rather than the strategy.

The Number the Tester Prints Is Not Evidence

Here is the part almost nobody does, and it is arithmetic rather than opinion.

Suppose a report shows 55 winning trades out of 100. The instinct is to read that as an edge. Statistically it is barely a whisper. Treating the trades as independent draws with a fixed underlying probability, the 95 percent confidence interval around that observation runs from 45.2 percent to 64.8 percent. It contains 50 percent. In other words, a hundred trade sample cannot distinguish that result from a coin.

This is not a target and not a claim about what any system achieves. It is a statement about how little a small sample can tell you, in either direction.

Chart on how to test an ea on mt5, showing how wide the 95 percent confidence interval on an observed hit rate stays at each backtest sample size
How to test an ea on mt5 and read the result honestly: the margin of error either side of an observed rate, by number of trades in the sample.

The width of that uncertainty shrinks with the square root of the sample, which is slow. At 30 trades the interval is about 17.8 points either side of the observation. At 100 it is 9.75. At 300 it is 5.63, and the interval still reaches below 50 percent. At 1,000 it is 3.08, and only there does the observation start to separate from noise. At 5,000 it is 1.38.

Working from the same normal approximation, pinning the underlying rate to within 2 points either way needs roughly 2,377 trades. That is the real cost of certainty, and it is why a backtest over eighteen months of a single symbol on a strategy that trades twice a week is not a body of evidence. It is one observation with error bars nobody drew.

The assumptions are stated and they are generous: independent trades, a fixed underlying probability, no changing market regime, no curve fitting. Every one of those is violated in real testing, and each violation widens the true uncertainty rather than narrowing it.

What a Losing Streak Actually Proves

The mirror of the same arithmetic answers the question that ends most live trials prematurely: the EA has lost seven in a row, is it broken?

Take a system that loses 45 percent of the time and treat the trades as independent. The chance that any specific block of seven consecutive trades are all losses is 0.3737 percent, which sounds like almost never. But across 300 trades there are many overlapping blocks, and the expected number of losing streaks of seven or longer works out at about 0.61. Roughly one streak of seven in every five hundred trades, as ordinary weather. A streak of ten or longer has an expected count of about 0.05 over the same 300 trades, so that one is genuinely rare.

The business consequence is that a drawdown limit must be set in advance, from arithmetic, and not discovered in the middle of one. A limit written while you are watching losses accumulate is not a control, it is a mood.

The Due Diligence That Sits Outside the Tester

Everything above assumes the EA is what it claims to be. Often it is not, and the test that catches that is not a test of the software at all.

The CFTC's advisory, AI Won't Turn Trading Bots into Money Machines, documents the Mirror Trading International case, and one detail in it should stop anyone shopping for an EA. Over about three years, Cornelius Johannes Steynberg took more than $1.7 billion in bitcoin from at least 23,000 people. Entry cost as little as $100 in bitcoin, no trading experience required, and the pitch was a proprietary bot trading foreign currencies with a guaranteed return of at least 10 percent a month, which is more than 200 percent a year. In reality very little money was traded at all. It was a Ponzi scheme.

Here is the detail. According to that same advisory, the operator created fake customer accounts and balances using MetaTrader demo accounts. The screenshots people were shown, the account histories, the growing balances, all of it could be produced by the same free software sitting on your own machine right now, in an afternoon, by anyone.

So a vendor's screenshot is worth nothing. A vendor's statement is worth nothing. A myfxbook style link is worth something only if you can confirm it is tracking a live account rather than a demo, and the distinction is not always displayed prominently. The only result that means anything is the one produced by data you supplied, on a platform you control, or by a small live account with your own money in it.

The advisory's own checklist is the right one to borrow: research the company and the people behind it, check the age of the domain registration through ICANN's public lookup, get a second opinion from someone with no stake, and account for how fees, spreads and subscription costs eat into any claimed result. For scale, the FBI's 2024 IC3 Annual Report puts reported investment fraud losses at $6,570,639,864 for the year, from 47,919 complaints, up from $3,311,742,206 two years earlier. This is not a rare corner of the market.

Write the Acceptance Test Before You Fund It

A business does not buy equipment and then decide afterwards what would count as it working. Write these down before the EA touches a funded account, in the plan, dated.

Decide the maximum drawdown that ends the trial, computed from the streak arithmetic above rather than from how it feels. Decide the trial length in number of trades rather than in weeks, because weeks are not the unit the statistics work in. Decide the capital at risk during the trial, small enough that the whole trial failing is an operating expense rather than an event. Decide what specifically you will compare against the backtest, slippage against modelled fills, spread paid against spread assumed, trade count against expected trade count. And write the review date down.

Then, when it goes wrong, you are executing a decision you made calmly rather than making one at the worst possible moment. That is the entire value of the exercise.

Free one page trading business plan

Get the free REX one page business plan, the sheet where the drawdown limit, the trial size and the review date live in one place instead of in your memory. One email, no spam, unsubscribe anytime.

Get the free business plan →

What This Does Not Say

It does not say EAs do not work, because plenty of professional trading is automated and none of that is in dispute. It does not say the confidence intervals above apply to your system, because real trades are not independent and real markets change regime. It does not recommend any product, vendor or platform. And it does not say a good backtest is worthless. It says a backtest is one piece of evidence with a knowable margin of error, and the margin is far wider than the report's decimal places suggest.

Frequently Asked Questions

How to test an ea on mt5 with real tick data?

Choose the every tick based on real ticks modelling mode in the Strategy Tester and download the symbol history first, then check the modelling quality figure the report gives you. If your broker does not supply real tick history for that symbol, the cheaper modes are approximations and any strategy that depends on intrabar behaviour should be treated as untested.

How many trades does a backtest need before I can trust it?

More than most people run. Under the stated assumptions, a hundred trades leaves a 95 percent interval nearly 20 points wide, and pinning a rate to within 2 points needs roughly 2,377 trades. Fewer than a few hundred trades is an anecdote with a chart attached.

The backtest is profitable but live trading is not. Why?

The usual culprits are optimistic spread assumptions, slippage that the model did not include, a modelling mode that interpolated the moments your entries depend on, or parameters fitted to the test period. Compare the live fills against the modelled fills line by line and the difference usually names itself.

Should I trust a vendor's backtest or live results screenshot?

No. The CFTC's advisory describes an operator who fabricated customer accounts and balances using MetaTrader demo accounts, and anyone can produce those in an afternoon. Test on data you supplied, on a platform you control, before any money is involved.

Where did the figures here come from?

The fraud figures are quoted from the CFTC advisory and the FBI IC3 2024 report. Every confidence interval, sample size and streak probability was computed by me from the normal approximation to the binomial under the assumptions listed in the disclaimer.

Where REX Fits

REX Trading Signal is free to follow. Daily XAUUSD setups with a stop loss, a reason and a rule, posted live, wins and losses alike, plus an optional Kit for people who want the operating side written down. Nothing here promises a profit and nothing here ever will.

Testing is a control, and controls belong in writing rather than in memory. The one page trading business plan template is where the drawdown limit and the review date go. Can I automate my trading strategy is the prior question this article assumes you have already answered. The key metrics every trading business should track is what you compare the live result against once the trial starts. And when to retire a trading strategy is the same discipline applied at the other end of the machine's working life.

About the author. Rex writes REX Trading Signal. He is interested in the unglamorous half of this business, the costs, the controls and the review dates, on the view that an account survives on its operating discipline long before it succeeds on its ideas.

Disclaimer: This article is general educational content about software testing procedure and the statistics of small samples. It is not financial advice, not a recommendation of any Expert Advisor, vendor, broker or platform, and not a suggestion to open any particular position. Trading gold, CFDs and leveraged products carries a high risk of losing money rapidly. No entry, stop or target discussed should be treated as a signal. The Mirror Trading International figures, the $1.7 billion, the 23,000 people, the $100 entry, the guaranteed 10 percent monthly claim and the use of MetaTrader demo accounts to fabricate balances, are quoted from the published CFTC customer advisory and describe a fraud rather than an achievable return. Investment fraud loss totals are quoted from the FBI Internet Crime Complaint Center's 2024 IC3 Annual Report and are reported losses from one reporting channel, which undercounts rather than overcounts. All confidence intervals, sample sizes and streak probabilities were computed by me using the normal approximation to the binomial distribution at 95 percent confidence, assuming independent trades, a fixed underlying probability, no regime change and no curve fitting; none of those assumptions holds exactly in real trading, and each violation widens the true uncertainty rather than narrowing it. The 55 out of 100 figure and the 45 percent loss rate are arithmetic illustrations chosen to demonstrate the width of the uncertainty and are not targets, forecasts, or claims about any strategy, system or account. The normal approximation is unreliable at very small samples and the intervals quoted should be read as indicative. Strategy Tester modes, menu names and reported statistics are set by MetaQuotes and by your broker's data feed and change between builds, so the platform's own documentation and your broker's terms are the authority and not this article. No gold price level is quoted anywhere in this article and no trading results are represented.

Write down what would make you stop before you fund the machine, not while you are watching it lose.

Daily XAUUSD setups with a stop loss, a reason, and a rule, posted live on Telegram, wins and losses alike.

Follow REX Trading Signal → Free to follow. No pressure, no countdown, stay as long as it earns your trust.

More from the journal