MT5 Strategy Tester, First Steps: Testing an Idea Without Code

A trader has an idea — a simple rule, such as entering when a fast moving average crosses above a slow one — and the only way to learn anything about it seems to be to trade it for months and see what happens. The Strategy Tester in MT5 offers a shorter route: it runs a rule over past prices and reports what would have happened, trade by trade, without risking money and without writing a line of code. By the end of this article, you will be able to run a first test on a built-in example, read its report without fooling yourself, and know the three ways a beginner’s test most often misleads.

Prerequisite: “Getting Started with MetaTrader 5: Install, Log In and Find Your Way Around” (Beginner Batch 2) — finding your way around the terminal, including the Toolbox and the Navigator. Pairs with “Designing a Backtest That Can Actually Falsify Your Idea” (Advanced Batch A1), which takes the questions this article raises — sample size, overfitting, honest cost assumptions — and treats them properly.

Key points

  • The Strategy Tester runs a trading rule over past prices and reports the trades it would have taken. It tests the rule, not the trader, and it says nothing about what the rule will do next.
  • A first test needs no code: MT5 ships with example programs that can be tested as they are, and the tester’s settings are four choices — the program, the symbol, the modelling mode and the date range.
  • The report’s headline numbers are net result, profit factor, maximal drawdown and number of trades. A profit factor above 1.00 means the winning trades outweighed the losing ones in the test; the trade count says how much weight that fact carries.
  • Costs belong in the test: a test run with no spread assumption is a test of a market that never existed, and its result flatters every rule it touches.
  • A test over a short window or a single symbol proves almost nothing, however good its numbers look. The beginner’s discipline is one setting at a time, one honest window, and the report read in full.

Start trading with Exness

You can open an account here:

In plain words

The Strategy Tester lets you run a trading rule over past prices and read what it would have done — trade by trade, with no money at stake and no code to write, because MT5 ships with example programs you can test as they are. A test is four choices — the program, the symbol, the modelling mode (how finely prices inside each bar are reconstructed) and the date range — and its report is read as a group, never as one number: net result, profit factor, maximal drawdown and the trade count that says how much weight the rest carries. In the article’s invented example, 120 trades over six months on an illustrative $10,000 deposit gave +$450 (4.5%), a profit factor of 1.23, a maximal drawdown of $620 (6.2%) and an expectancy of +$3.75 per trade — while the same rule on a single month showed a far better profit factor of 2.36 on only 18 trades, and was worth far less, because one month and a handful of trades are not a sample. Two disciplines hold the whole thing together: costs belong in the test, since a test with no spread assumption describes a market that never existed, and the settings belong with the result, changed one at a time — a rule that loses in the tester will not become a winner live, and a rule that wins has only earned the next question.

1. What the Strategy Tester does, and what it does not

The Strategy Tester is a panel in MT5 that takes a trading program — an Expert Advisor, or EA — and runs it over historical prices, bar by bar or tick by tick, exactly as the program’s rules dictate. Every time the rules say to open a trade, the tester opens one at the historical price; every time they say to close, it closes one. At the end of the run it produces a report: how many trades were taken, how much they made and lost, how far the balance fell from its peak, and a dozen other figures. The whole exercise happens on past data, on a demo basis, with no money at stake.

Three things the tester does not do are as important as what it does. First, it does not test the trader. A rule that is followed mechanically in a test is followed by a human being in live trading, and the human hesitates, exits early, skips the losing-looking setup and doubles the winning-looking one. A test result describes the rule as written; the gap between the rule as written and the rule as traded is where most of the difference between a test and a live account lives. Second, the tester does not know the future. Past prices are a single sample of what the market did, and a rule that profited on that sample may have profited because the sample favoured it — a rising market flatters trend rules, a ranging market flatters range rules, and the tester cannot tell you which kind of market comes next. Third, the tester does not know what it was not told. If the test assumes no spread, no slippage and no swap, it tests a frictionless market that no trader ever trades in, and its numbers describe that imaginary market, not the real one. A rule that loses in the tester will not become a winner by being traded live; a rule that wins in the tester has earned the next question, which is whether the win survives a longer window, a different symbol and realistic costs.

2. Opening the tester and the four choices every test needs

The tester lives in the Toolbox at the bottom of the terminal, in its own tab, or under the View menu as “Strategy Tester”. Opening it shows a panel of settings, and a first test needs only four of them chosen deliberately. The rest can stay at their defaults until the reader understands what they change.

  • The program (Expert Advisor). The tester runs a program, not a chart pattern drawn by hand. For a first test, use one of the example programs that ship with MT5 — the “Moving Average” example and the “MACD Sample” example are both installed with the terminal and appear in the Navigator under Expert Advisors. They are simple, documented examples, and their rules are visible in their descriptions: the Moving Average example opens a position when a short-period average crosses a long-period average, and closes it when the cross reverses. Using a shipped example matters, because the reader then knows the rule being tested is a known quantity, not a file of unknown origin — the safety question that Article 3 of this batch treats in full.
  • The symbol. The instrument the test runs on, for example EURUSD. One symbol per test: the tester tests one symbol at a time, and a rule’s behaviour on one symbol says little about its behaviour on another.
  • The modelling mode. How the tester reconstructs prices inside each bar. The choices, from most detailed to fastest, are: “Every tick based on real ticks”, “Every tick”, “1 minute OHLC” and “Open prices only”. Real-tick modelling is the most faithful and the slowest; open-prices-only is the fastest and the crudest, because it only looks at each bar’s opening price. For a first test on a rule that trades on bar closes, “1 minute OHLC” or “Every tick” is a reasonable middle ground. The table in Section 3 compares the modes.
  • The date range. The period the test covers, chosen with the “Date” setting. A first test over six months of hourly data gives roughly three thousand bars and, for a typical simple rule, dozens of trades — enough to practise reading the report, and far too few to prove anything, as Section 4 explains.

Two more settings deserve a mention because beginners meet them immediately. The deposit setting fixes the starting balance for the test — an illustrative $10,000 is used in this article’s worked example — and the leverage setting fixes the leverage the test assumes. Both change the money figures in the report, so they must be written down with the result: a test that made $450 on a $10,000 deposit is a different statement from the same rule making $450 on a $1,000 deposit, even though the trades were identical.

3. The modelling modes, and what each one costs you

The modelling mode decides how much of the market’s real movement the tester sees inside each bar, and the choice is a trade between accuracy and speed. The table below summarises the four modes a beginner meets. All four test the same rule; they differ in how finely they reconstruct the prices the rule reacts to.

Modelling modeWhat the tester sees inside each barSpeedWhen to use it
Every tick based on real ticksThe actual ticks recorded for the symbolSlowestFinal check of a rule that trades inside bars
Every tickA reconstructed tick sequence from the bar’s pricesSlowRules that react to prices within a bar
1 minute OHLCThe open, high, low and close of each minuteMediumA first test of a rule that trades on bar closes
Open prices onlyOnly each bar’s opening priceFastestA quick first pass, or a rule that only acts at the open

Two cautions belong with the table. First, the faster modes can flatter a rule: a rule that is tested only on opening prices never faces the worst price inside a bar, so its stops are never hit by an intra-bar spike that the test never saw. A rule that looks good on “Open prices only” and falls apart on “Every tick” was never a good rule — it was a good rule for a market that only moves at bar opens.

4. Reading the report: four numbers, and the trade count that weights them

When a test finishes, MT5 shows a report with a summary and a table of trades. Beginners should read four numbers first, and read them together, because each one corrects the others.

  • Total net profit. The sum of all the trades’ results, in money, after the test’s assumed costs. In the worked example it is +$450 on an illustrative $10,000 deposit — a gain of 4.5% over six months of testing, before any conclusion is drawn from it.
  • Profit factor. Gross profit divided by gross loss. A profit factor of 1.00 means the wins exactly paid for the losses; above 1.00, the wins outweighed the losses; below 1.00, the rule lost money in the test. The worked example’s profit factor is 1.23, computed in Section 5. A profit factor is not a grade: 1.23 over 120 trades is a different statement from 1.23 over 12 trades, which is why the trade count is read with it.
  • Maximal drawdown. The largest fall from a peak of the balance during the test, in money and as a percentage of the deposit. The worked example’s maximal drawdown is $620, or 6.2% of the illustrative deposit. Drawdown is the number that describes what living with the rule felt like: the balance did not rise smoothly to +$450, it fell $620 below a previous peak along the way, and a trader running the rule would have had to sit through that fall without abandoning it.
  • Total trades. The count of trades the test took. It is the weight of the whole report: 120 trades carry more evidence than 12, and 12 trades carry almost none, however spectacular their profit factor. The margin-of-error reasoning from the journal batch (M3, Article 4) applies here too — a win rate measured from a handful of trades is mostly noise.

The report also shows expected payoff, the average result per trade — the tester’s version of the expectancy from the journal articles, computed both ways as a cross-check in Section 5. A habit to form now: save the report with its settings. The tester can save the report as a file, and the file is worthless without the four choices from Section 2 written on it — program, symbol, mode, dates — plus the deposit, the leverage and the spread assumption. A result without its settings is a number without a test, and it cannot be repeated, compared or trusted.

5. A worked example (illustrative)

An illustrative first test. The rule is the shipped “Moving Average” example: it opens a position when a short-period moving average crosses a long-period moving average, and closes it when the cross reverses. The symbol is EURUSD, the timeframe is H1, the period is 1 January to 30 June 2026, the modelling mode is “1 minute OHLC”, the starting deposit is an illustrative $10,000, the size is fixed at 0.10 lots for every trade, and the test assumes an illustrative spread cost built into each trade’s execution price. Every figure below is invented for illustration.

Step 1 — Count the trades and the wins. The test took 120 trades: 54 wins and 66 losses. Total: 54 + 66 = 120 trades. Win rate = 54 ÷ 120 = 0.45, or 45%. Loss rate = 66 ÷ 120 = 0.55, or 55%. Check: 45% + 55% = 100%.

Step 2 — Add up the wins and the losses. The 54 winning trades totalled $2,430 gross profit. Average win = $2,430 ÷ 54 = $45.00. Check: 54 × $45.00 = $2,430. The 66 losing trades totalled $1,980 gross loss. Average loss = $1,980 ÷ 66 = $30.00. Check: 66 × $30.00 = $1,980.

Step 3 — Net result and profit factor. Net result = $2,430 − $1,980 = +$450. As a percentage of the illustrative deposit: $450 ÷ $10,000 = 0.045, or +4.5% over the six-month test window. Profit factor = gross profit ÷ gross loss = $2,430 ÷ $1,980 = 1.227, or about 1.23. Check: $1,980 × 1.227 = $2,429.46, which rounds to $2,430.

Step 4 — Expectancy, two routes. Route one: expectancy = (win rate × average win) − (loss rate × average loss) = (0.45 × $45.00) − (0.55 × $30.00). First term: 0.45 × $45.00 = $20.25. Second term: 0.55 × $30.00 = $16.50. Expectancy = $20.25 − $16.50 = +$3.75 per trade. Route two: net result ÷ trades = $450 ÷ 120 = $3.75 per trade. The two routes agree, as they must.

Step 5 — Drawdown and recovery. The report’s maximal drawdown is $620. As a percentage: $620 ÷ $10,000 = 0.062, or 6.2% of the deposit. Recovery factor = net result ÷ maximal drawdown = $450 ÷ $620 = 0.726, or about 0.73. The rule earned $450 while putting the balance $620 below a previous peak at its worst point — the gain was smaller than the fall it took to get there.

Step 6 — The short-window contrast. The same rule, tested on January 2026 alone: 18 trades, 11 wins totalling $495 and 7 losses totalling $210. Net result = $495 − $210 = +$285. Profit factor = $495 ÷ $210 = 2.357, or about 2.36. Win rate = 11 ÷ 18 = 0.611, or about 61%. The one-month test looks far better than the six-month test — a profit factor of 2.36 against 1.23 — and it is worth far less: 18 trades carry a margin of error wide enough to swallow the difference, and a single month is a single market mood, not a sample of moods. The six-month test, with its modest 1.23, is the more honest of the two, and even it is only a first test: one symbol, one period, one set of settings.

The example’s lesson is in the comparison, not in any single number: the same rule, two windows, two very different stories — and the story that looks better is the one built on less evidence.

6. The first-test checklist

  • Program chosen deliberately: a shipped example, or a file whose origin you can check — never a file from an unknown source, for the reasons in Article 3.
  • One symbol, one timeframe, one date range: written down before the run, so the test can be repeated exactly.
  • Modelling mode understood: a quick first pass may use “Open prices only”, but a result is not trusted until it has been checked on a finer mode.
  • Costs in the test: the spread assumption written down with the result; a test with no spread assumption is a test of a market that never existed.
  • Report read in full: net result, profit factor, maximal drawdown and trade count together — never the net result alone, never the profit factor without the trade count.
  • Nothing changed mid-test: one setting at a time. Changing the symbol, the period and the rule’s inputs together and re-running until the numbers look good is not testing; it is fitting the rule to the past, and the advanced batch (A1) explains why that fails.
  • Result saved with its settings: program, symbol, mode, dates, deposit, leverage and spread assumption on the same file as the numbers.

Summary — what to take away

  • The Strategy Tester runs a rule over past prices and reports the trades it would have taken. It tests the rule as written, not the trader, and it cannot say what the rule will do next.
  • A first test needs no code: a shipped example, one symbol, one modelling mode and one date range are the four choices, and the rest can stay at their defaults.
  • The report is read as a group: net result, profit factor, maximal drawdown and trade count together. In the worked example, 120 trades gave +$450 (4.5%), a profit factor of 1.23, a maximal drawdown of $620 (6.2%) and an expectancy of +$3.75 per trade.
  • The same rule on a single month looked far better — a profit factor of 2.36 on 18 trades — and was worth far less, because 18 trades and one market mood are not a sample.
  • Costs belong in the test, settings belong with the result, and one setting changes at a time. A rule that loses in the tester will not become a winner by being traded live.

Next reads

  • Designing a Backtest That Can Actually Falsify Your Idea (Advanced Batch A1) — the verification discipline this article points toward: sample size, overfitting, and honest cost assumptions.
  • Getting Started with MetaTrader 5: Install, Log In and Find Your Way Around (Beginner Batch 2) — the terminal layout, Toolbox and Navigator that this article builds on.
  • Your First 50 Trades as Data: Win Rate, Payoff and Expectancy from Your Own Log (M3) — the same three numbers (win rate, payoff, expectancy) computed from live journal rows instead of a test report.

FAQ

Q: Do I need to know how to program to use the Strategy Tester?
A: No. The tester runs a program, but MT5 ships with example programs — the “Moving Average” and “MACD Sample” examples — that can be tested exactly as they are. Programming becomes relevant only when you want to test a rule of your own design, which is a later step; the first skill is reading a report, not writing code.

Q: My test shows a large profit. Does that mean the rule works?
A: It means the rule profited on that symbol, in that period, under those settings and cost assumptions. A large profit over few trades, a short window or a single symbol is weak evidence, and a test with no spread assumption flatters every rule. The honest response is to extend the window, try a second symbol and check the result on a finer modelling mode — and to let the advanced verification articles set the standard for a verdict.

Q: What is the difference between “Every tick” and “Open prices only”?
A: It is how finely the tester reconstructs prices inside each bar. “Every tick” rebuilds a tick sequence from the bar’s prices, so the rule faces prices within the bar; “Open prices only” looks at each bar’s opening price alone, so the rule never faces an intra-bar spike. Open-prices-only is fast and useful for a first pass, but a result should not be trusted until it has been checked on a finer mode.

Q: Why does the tester ask for a deposit and leverage?
A: Because the money figures in the report — net profit, drawdown — depend on them. The same trades make the same profit in money terms at a fixed lot size, but the drawdown as a percentage of the deposit changes with the deposit, and the leverage setting changes how much margin each trade uses. Both must be written down with the result, or the result cannot be compared with another test.

Q: Can the tester tell me the best settings for a rule?
A: It can show what each setting would have done in the past, and that is exactly the trap the advanced batch warns about: changing settings until the past looks good fits the rule to one sample, and the fitted rule usually fails on new data. Change one setting at a time, record each run with its settings, and treat a setting that only works on one window as a warning, not a discovery.

Sources: MetaTrader 5 Help pages “Strategy Testing” and “Testing Report” (MetaQuotes) for the Strategy Tester, its modelling modes and the report figures; MetaTrader 5 Help page “Expert Advisors” for the shipped example Expert Advisors. Checked: 22 November 2026. The worked example in Section 5 is illustrative, with invented figures.

This article is information only and is not investment advice. Forex and CFD trading involves a substantial risk of loss, including the possibility of losing more than you deposited with some account types and jurisdictions. Practise on a demo account until every procedure in this batch is familiar. Make sure you fully understand how leveraged products work before you consider trading with real money.

Disclosure: Broker Cost Check is reader-supported. If you open an account through a partner link on this page and trade, Exness pays us a share of the revenue from your trading activity under its partner programme. You pay us nothing: our payment comes from Exness, out of that revenue. How we make money: How Broker Cost Check works — method and how we make money

Sources

Checking and corrections: how we check figures and handle corrections is set out on our method page. The official pages for the terms covered on this page are listed under Sources below.

Official Exness pages for the terms covered on this page:


Comments

Leave a Reply