Case study

Systematic MT5 backtesting & strategy validation

How I set up a test so the number at the end actually means something — and so the same test can be run again next month and still be comparable.

The problem

A backtest is easy to make look good. Pick the right period, leave out costs, tune the parameters until the curve is smooth, and any strategy passes. The result then describes the tuning, not the strategy. The work is in setting the test up so that does not happen.

How I test

  • Real tick data rather than modelled ticks where the data allows it
  • Multi-year windows that include more than one market phase
  • Spread, commission and slippage stated as explicit assumptions, not left at defaults
  • Parameter testing to see how sensitive a result is, not to find the single best value
  • An out-of-sample segment that is not used while tuning
  • Robustness checks: does the result survive small changes to parameters, symbol and period
  • Results collected in a common format so runs can be compared against each other
TEST WINDOW in-sample out-of-sample tuned here never touched while tuning robustness: parameters · symbol · period
Schematic only — it shows the split, not a result.

What a backtest cannot tell you

The Strategy Tester has limits that belong in the conversation, not in the small print. Execution in the tester is not execution at a broker. Historical spread is an assumption. Requotes, latency and partial fills do not appear. A result that only holds for one symbol, one period and one exact parameter set is a curve-fit, however good it looks.

A backtest describes past data under stated assumptions. It is not a forecast, and I do not present it as one.

Technologies

  • MetaTrader 5
  • Strategy Tester
  • MQL5
  • Python

Current status

This methodology is what runs inside the EA Factory pipeline and what I apply to client strategies. If you want your existing EA tested this way, that is a project on its own — it does not require rebuilding anything.