Lab Note #04 · All Lab Notes

Running the first backtest

The first backtest answers a modest question: does the implementation behave as specified? A profitable curve cannot answer that on its own.

Begin with a compiled EA whose entry, exit and position ownership logic you have checked. The previous note provides implementation excerpts, not a finished binary. Keep the 20/50 periods and 0.1-lot volume fixed for this run; optimisation would obscure the baseline.

Write the run record first

Choose the dates before seeing results. For example, use 1 January 2020 through 31 December 2022 for development, reserving later history for validation. These are proposed experiment dates, not a claim that a test has been run. Confirm that your broker has suitable history and record the tester’s exact start and end timestamps.

RecordWhat to save
ImplementationSource version, compiled EA and input settings
MarketBroker/server, exact EURUSD symbol, H1 and date range
AccountDeposit, currency, leverage and netting or hedging mode
SimulationTick model, execution delay, spread, commission and swap assumptions
EnvironmentTerminal build and any missing-data warnings

Configure a single test

Open Strategy Tester, select the EA, choose the broker’s EURUSD symbol and H1, set your dates and account assumptions, and disable optimisation. Select Every tick based on real ticks where suitable history is available. Real ticks improve the price-path evidence, but do not reproduce every live liquidity or execution condition.

Use visual testing to inspect a short section before running the full period. Faster models can help with early debugging, but a bar-based entry rule alone does not establish that every modelling mode gives equivalent fills. MetaTrader documents the available settings in its Strategy Testing guide.

Inspect a reversal by hand

  1. Find a completed bar where the fast average crosses the slow average.
  2. Check that the previous bar was on the other side or equal.
  3. Verify that the decision occurs on the following bar, not inside the signal bar.
  4. Inspect the existing position’s close and the new entry separately.
  5. Compare requested and filled volumes, prices and timestamps with the log.

Also inspect a quiet stretch without crossovers. An EA that trades on every tick while the fast average is above the slow average has implemented a state condition instead of a crossing event. A report showing no trades is a debugging clue: check data readiness, lot constraints and rejected orders before concluding the strategy found no signals.

Account for the cost model honestly

Check the actual spread, commission and overnight charges reflected in the report. Do not assume the broker’s current account schedule reconstructs every historical fee. Document any mismatch. Execution delay and an order’s permitted deviation are different from a fixed adverse slippage charge.

Keep the one-pip-per-side assumption as an explicit sensitivity calculation if it is not implemented in the fill model. A post-processing deduction estimates direct cost only; it cannot reconstruct changed margin decisions, stop-outs or missed trades. Do not present it as an equivalent execution simulation.

Save evidence, including failures

Save the report, input set, deal list, tester journal and a screenshot of the inspected crossover. Record forced closure at the end of the test, if any, so it is not mistaken for a strategy exit. Keep failed runs too: they explain why a later code version changed.

No backtest report is published in this note. The deliverable is a reproducible procedure and an evidence checklist. Once those checks pass, we can ask what the performance statistics actually tell us.

Building or reviewing your own trading system?

I can help turn the specification, implementation and testing into a coherent engineering process. Discuss your project.