Build a reproducible MT5 backtest before optimizing an EA

A practical baseline workflow: preserve settings, separate research from evaluation, record costs and failures, and define what another reviewer must reproduce.

BamaUp Editorial ·
Original BamaUp lesson slide explaining explicit rules and testable MT5 automation
Original BamaUp educational video artwork; not a screenshot of live trading performance.

Start with a result that somebody else can reproduce

Optimization is tempting because it produces a ranked list. Yet a ranking is difficult to interpret when the underlying experiment is not documented. Before looking for better parameters, create one baseline that a second person could repeat. The goal is not to make that first report impressive. The goal is to establish exactly what was tested and which assumptions were used.

This is a proposed engineering workflow, not a claim that a particular EA is profitable. It is suitable for a demo research project and does not require a funded account. A reproducible loss can be more informative than an unexplained profit, because it gives the next experiment a clear point of comparison.

Freeze the experiment description

MetaTrader's tester distinguishes a single test with specified inputs from optimization over input combinations. Its official documentation describes test periods, modeling choices and execution-delay settings [1, 2]. Our practical suggestion is to keep a short experiment record alongside the exported settings and complete report.

Write the EA build identifier, symbol, broker, account currency, period and timeframe in that record. Add the modeling choice and the assumptions used for spread, commission and execution. Record any symbol settings you changed. Give the experiment a unique name rather than overwriting a folder called latest. Those choices make comparison possible when a later run produces a different result.

Change one research question at a time

Imagine that you simultaneously change the trading rule, the cost assumption and the historical period. A better result cannot tell you which change mattered. A simpler experiment changes one assumption while preserving the others. For example, compare the same inputs and date range under a more demanding cost assumption. Save both reports, including the unfavorable one.

This is not a promise that a single-variable experiment captures every market interaction. It is a practical way to make your research notes understandable. Once an interaction becomes the research question, document it explicitly. The notebook should explain why an experiment was run, not merely list the final return.

Protect the evaluation period from repeated tuning

The official MT5 workflow includes forward-testing options that separate a later portion of data from the optimization period [1, 2]. That feature does not remove the need for research discipline. Decide the separation before looking at the result, and write down which information was available when each choice was made.

If a reserved period repeatedly influences your parameters, it is no longer untouched evidence. Label it honestly as part of the research process. Keep a genuinely independent evaluation where feasible, and explain the limitations when the available history is short. A single successful holdout is evidence to investigate, not proof that future conditions will behave the same way.

Review the report and the operating behavior

The testing report exposes multiple statistics rather than one universal quality score [3]. Use the documented definitions, and compare returns with drawdown, the number of trades and the distribution of outcomes. Do not treat a screenshot as a substitute for the report and configuration needed to understand it.

Then ask separate engineering questions. What happens after a restart with an open position? What explains a skipped signal? Can rejected orders produce accidental retries or duplicates? These questions require explicit tests; a historical equity curve alone does not answer them. Keep observed behavior distinct from assumed behavior in the delivery notes.

A concrete exercise for your next session

Create two experiment folders. In the first, save a baseline configuration, complete report and a short explanation of the rules. In the second, change only one clearly stated cost or execution assumption and repeat the test. Write a comparison in plain English: what stayed the same, what changed, what happened and what remains uncertain.

Finally, ask another reviewer to repeat the baseline using only your folder. Every question they must ask is a documentation gap to fix. Continue with BamaUp's free Auto-Trading Foundations lesson and the EA checklist. All examples are educational, and neither testing nor automation guarantees a trading outcome.

Sources and further reading

1. MetaTrader 5 — Strategy Testing2. MetaTrader 5 — Optimization Types3. MetaTrader 5 — Testing Report

Prepared with AI assistance. Hypothetical examples are not BamaUp trading performance.