Home › Guides › Forex Strategy Tester

TESTING TRAPFREENO ACCOUNTAUTOMATED TRADE BOTSForex StrategyTesterWhy a good backtest can lieEDUCATION ONLY | NO SIGNALSEXAMPLE NUMBERS ARE LABELLEDAUTOMATED TRADE BOTSautomatedtradebots.com
A free page on forex strategy tester. Education only, with example numbers labelled.
TESTING TRAP

Forex Strategy Tester

Short answer

A forex strategy tester replays stored prices through an expert advisor and records what it would have done. It tests a rule against the past. It does not test the future.

The MT5 tester can replay data, run thousands of passes and hold back a forward period. Each of those helps, and each can mislead.

The page explains the idea in plain words, works through the arithmetic with a table, and shows how it hits grid, martingale and DCA bots, then tells you what to check before you run one.

  • A worked example with real arithmetic
  • How it hits grid, martingale and DCA bots
  • How to check for it before you run a bot
  • No advice, no signals, no profit promises

Last reviewed 28 October 2026. Education only, not advice.

Free, no account Runs in your browser Worked numbers shown Not advice Examples labelled

Ready to go further

Next: learn to hold back data properly

The walk forward testing page shows how to repeat the optimise-then-test split through time instead of once.

Reading time6 minutes
Worked exampleExact arithmetic
Tools linked0 on this page
Reviewed28 Oct 2026

What is included

  • What it is, in plain words
  • The formula or mechanism, with exact arithmetic
  • How it hits grid, martingale and DCA bots
  • A check you can run before you switch a bot on

Who it is for

  • People who run or plan to run a trading bot
  • Anyone reading a backtest or a bot sales page
  • Readers who want the numbers, not the pitch
  • Not advice, and not a signal service
The best optimisation pass, seen and then unseen (made-up example)$3,960In-sampleoptimiser saw it-$820Forwardoptimiser did notMade-up example, input value 30 on a 10,000 test deposit. In-sample is two years, forward is six months.
The picture for this page. Example numbers are made up unless the page says they were calculated.

Key facts

  • A forex strategy tester replays stored prices through an expert advisor and records what it would have done. It tests a rule against the past. It does not test the future.
  • The result depends first on the data: real ticks, generated ticks or only bar prices. The finer the data, the closer a test can get to real fills, and the slower it runs.
  • Optimisation runs the same rule many times with different inputs and ranks the passes. The top pass is the one best fitted to that data, which is not the same as the best rule.
  • Worked example (made-up): the best of 8 passes made $3,960 in-sample and -$820 in the forward period, and 3 of 8 passes lost money forward (calculated by us on 29 Oct 2026, exact).
  • Menus and option names differ between versions and brokers, so this page describes the ideas, not the clicks. Check the documentation of your own platform.

What the tester does

The MT5 platform includes a tester that runs an expert advisor over stored history. You choose the symbol, the period, the deposit, the inputs and a modelling mode, and the tester steps through the data, lets the advisor place orders, and reports the result. The older platform has its own version, covered on MT4 strategy tester, and the two differ in important ways. For the platforms themselves see MT4 vs MT5. More generally, this is backtesting, with every trap that comes with it.

A tester can only replay what it has. If the stored history has gaps, wrong prices or a different spread from the one you will trade, the result inherits that. This is why the data settings come first.

Tick data and modelling modes

A tick is one change in the quoted price. Between two ticks nothing is known. A bar (a candle) summarises many ticks into four prices: open, high, low and close. The tester has to decide how to turn stored data into the price path the advisor sees. In general terms there are three kinds of mode, and the names vary by version:

  • Real ticks. The tester replays recorded ticks from the data source. This is closest to what happened, and it is the slowest. Its quality depends on how complete the tick record is.
  • Generated ticks. The tester builds a plausible tick path inside each bar from the bar prices. It is faster, and the path is an estimate. The estimated path can decide whether a stop or a target was hit first inside a bar, and that single question changes results for scalpers and tight-stop rules.
  • Bar prices only. The tester uses open prices, or the four prices of each bar, and nothing inside. It is quick and fine for rules that act once per bar. It is poor for anything that reacts inside a bar.

A fixed spread in the test is another trap. A real spread widens at rollover and around news, and a test that used a flat low value understates costs. See spread and slippage.

Optimisation passes

An optimisation runs the same advisor many times, each with different input values, and ranks the results by a measure you choose, such as profit or a ratio. Each run is a pass. With three inputs and ten values each there are a thousand passes. Some versions can also run a faster genetic search that samples the space instead of trying every combination.

Two things are worth knowing. First, every pass is another chance to get a lucky result: try enough combinations and one will fit the history well by chance. Second, the ranking measure matters. Ranking by raw profit favours the pass that took the biggest risk. A measure that includes drawdown or trade count is less easily fooled, but it can be fooled too.

The forward period

The tester can hold back a stretch of history that the optimiser does not use for ranking. This is a forward period. You optimise on the first part, then look at how the chosen inputs behave on the held-back part. Some versions can split this for you automatically. The idea is the same as walk forward testing, which repeats the split through time, and it is a cousin of forward testing on live data. Without a held-back period, the in-sample result is the only number you have, and it is the most flattering one.

Worked example: why the top pass disappoints

Everything here is made up. An advisor has one input, a lookback length. The optimiser tried 8 values over two years of data (the in-sample period). The held-back forward period is the next six months. The test deposit is $10,000.

Input valueIn-sample profitIn-sample rankForward profitForward rank
10$1,8505$3102
20$2,4204-$1506
30$3,9601-$8208
40$2,8703$2404
50$1,2107$4101
60$3,1502-$3907
70$9808$1505
80$1,6406$2803

Calculated by us on 29 Oct 2026, exact. The optimiser would pick input 30: first in-sample with $3,960. In the forward period the same input made -$820, ranked 8 of 8. The input that did best going forward was 50, which ranked 7 of 8 in-sample. The average pass made $2,260 in-sample and $4 forward, and 3 of 8 passes lost money in the forward period.

The pattern is the point. The in-sample ranking had almost nothing to say about the forward ranking. Picking the top pass was picking the one most closely fitted to the two years it was shown. That is overfitting, and optimisation is the process that produces it.

Profit by input value: in-sample against forward (made-up)-1,00002,0004,0001020304050607080$3,960Input value (solid: in-sample, dashed: forward)Made-up example. The in-sample peak is not the forward peak.
The solid line peaks at input 30. The dashed forward line is lowest at that same point.
Made-up numbers. Eight passes and one input are far fewer than a real run, and a real run can look different. The example shows the mechanism, not how often it happens.

Why optimisation overfits

  • Many tries, one history. The more passes, the more likely the top one is luck. The history never changes, so the optimiser keeps asking the same data for a better answer.
  • Peaks are narrow. A real edge usually works across a neighbourhood of inputs. A single tall spike between weak neighbours is a sign of fitting. In the table, input 30 sits between $2,420 and $2,870 neighbours.
  • The best number hides the path. Profit alone says nothing about the deepest drop, the longest losing run or how many trades there were.

How it hits bots

Grid and martingale advisors are the easiest to flatter. Their win rate is high by design, and a test period without a strong one-way move never meets the losing run. Optimisation then picks the step size and multiplier that avoided it in that history. Scalping advisors depend on the tick path inside a bar, so a bar-only mode can show results that real fills would not.

How to check a tester result

  • Note the mode, the date range, the spread setting and whether commissions were included.
  • Count how many passes the optimiser tried, and look at the neighbours of the chosen input, not only the top row.
  • Hold back a forward period, and read that result first.
  • Rerun on a different symbol or a different stretch of dates with the same inputs.
  • Follow with a demo run. See demo account.

What this page does not tell you

It does not tell you which menu to open, because that differs by version, and it does not say any advisor works or fails. A tester result, however carefully made, is a statement about the past.

FAQ

Frequently Asked Questions

What does a forex strategy tester do?

It replays stored prices through a trading rule or expert advisor and records the trades it would have made. It tests a rule against the past only.

What is the difference between real ticks and generated ticks?

Real ticks are recorded price changes replayed as they happened. Generated ticks are an estimated path built inside each bar. The estimate can change which of a stop or a target is hit first.

What is an optimisation pass?

One run of the advisor with one set of input values. An optimisation runs many passes and ranks them. The more passes, the more likely the top one is a lucky fit.

What is a forward period?

A stretch of history held back from the optimiser. You pick inputs on the first part and read how they behave on the held-back part. It is a test of whether the fit carries over.

Why does the best pass often disappoint?

It is the pass most closely fitted to the data it was ranked on. Part of that fit is luck, and luck does not repeat in the next period.

Are the numbers on this page real?

Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.

Can I use this to decide whether to run a bot?

It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.

Is this financial advice?

No. It is general education about how testing tools work. The example numbers are made up and menus vary by version.

Know the Risk Before You Run It

Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.

Trading carries a risk of loss