Skip to main content

EA backtests: What the results can and cannot tell you

An EA backtest simulates a strategy on historical data. It is not a prediction or a guarantee of future returns.

An EA backtest simulates a strategy on historical data. It is not a prediction or a guarantee of future returns.

Understand the test

Results depend on the chosen symbol, period, price data, modelling method, trading costs, execution assumptions and EA settings. Compare tests using the same documented assumptions; a favourable result alone does not prove the setup is realistic.
​

Backtesting evaluates selected settings. Optimisation tries multiple settings to find better historical results. Selecting the best historical combination can overfit the past.


Set up a single EA backtest in MT4 desktop

  1. Open View → Strategy Tester or press Ctrl+R. In Settings, select the compiled Expert Advisor already available in your platform.

  2. Select the full Symbol and Period (chart timeframe). Enable Use date and enter From and To to restrict the historical range.

  3. Choose Model: every tick, control points or open prices only. Open-price testing does not reproduce all movements within a candle; record the selected method with the result.

  4. Check Spread. The default uses the symbol’s spread at the start of testing to model Ask prices from Bid history; a custom spread is also possible. This is not continuously changing historical spread.

  5. In Expert properties → Testing, set the simulated initial balance, currency and allowed trade directions. Under Inputs, set each Value; the Start, Step and Stop ranges apply to optimisation.

  6. Leave Optimization off for one fixed-parameter test. Optionally enable Visual mode, then click Start. Afterwards inspect Results, Graph, Report and Journal, including modelling quality and errors.


MT4: Optimise inputs and retest a selected pass

Optimisation repeats a historical simulation with different selected input values.

  1. In Tester → Settings, select an available EA, symbol, timeframe, modelling method, date range and spread. Enable Optimization; leaving it disabled runs a single fixed-input test.

  2. Open Expert properties → Testing. Set the simulated deposit, currency, permitted trade directions and ranking criterion. Choose genetic search only if intended.

  3. In Inputs, check each parameter to vary and set its Start, Step and Stop fields. An unchecked parameter retains its Value.

  4. In Expert properties → Optimization, enable and configure only the pass limits you intend. Reaching a limit interrupts that pass; the next pass continues.

  5. Select Start. Inspect Optimization Results and Optimization Graph; results summarise passes, not every trade. Sort by a column and check whether Skip Useless Results is hiding unprofitable passes.

  6. Double-click a pass or choose Set Input Parameters. MT4 restores its inputs to Settings and disables Optimization. Check the restored values, then select Start for a single test.

Input field

Meaning

Start

Initial value

Step

Increment

Stop

Final value

Value

Fixed value when the parameter is unchecked

Keep the selected inputs and actual test period. Choosing a historical winner is not an independent check on future data and does not establish future profitability.


Set up a single EA backtest in MT5 desktop

  1. In Navigator, open the EA’s context menu and choose Test. In the tester’s Settings, choose a single test rather than parameter optimisation.

  2. Choose the main Symbol, timeframe and Date range; the end date is excluded. For a multi-symbol EA, enable its required instruments in Market Watch → Symbols.

  3. Review the tick-modelling mode and execution delay. Generated ticks and available real ticks are different data choices; a no-delay test represents ideal execution rather than evidence of live performance.

  4. Set the simulated initial balance, currency and leverage, then enter the EA’s Inputs. Record these assumptions alongside the test; they describe the simulation.

  5. For chart playback, enable visual testing with a local agent and optimisation off. Click Start in Settings; history downloads may take time.

  6. Review Result, Graph and Journal. Check data-related messages and any shifted start date, then keep the report with the EA version and settings. Read the interpretation below before comparing results.


Configure parameter optimisation in MT5 desktop

  1. Open the EA’s Test command in Navigator. In Settings, confirm the symbol, timeframe, dates and simulation assumptions.

  2. Select parameter optimisation rather than a single test.

  3. In Inputs, tick parameters to vary. Set Start, Step and Stop; unticked parameters remain fixed. Review the displayed combination count.

  4. Choose a search mode and, for genetic optimisation, a ranking criterion.

  5. Set Forward before starting if required, using the instructions below.

  6. Click Start. After completion, sort Optimization Results by a column heading. Double-click a pass to test its parameters in a single run.


Choose an optimisation method

Slow complete algorithm evaluates all selected combinations and can take substantial time. Fast genetic algorithm searches a smaller set; it does not prove every combination was tested. Its criterion ranks passes, rather than certifying a profitable strategy. Record the mode and criterion.

Profit-in-pips estimation omits swaps, commissions and margin checks. Use a more detailed mode before evaluating risk; this shortcut does not reproduce all trading costs.


Reserve and compare a forward period

  1. In Settings → Forward, select 1/2, 1/3, 1/4 or Custom.

  2. The later part of Date is reserved; optimisation uses the earlier part. For Custom, set its start date.

  3. After completion, compare selected passes in Optimization Results and Forward Results. Not every combination is necessarily forwarded.

  4. Keep both periods and parameter sets with the reports. Re-tuning on the forward period removes its independence.


Choose the MT5 tick-modelling mode deliberately

Mode

What the choice means

Every tick

Simulates intermediate prices from minute bars; this is not recorded real-tick history.

Every tick based on real ticks

Uses available broker ticks, with spreads that can vary within a minute. Missing tick minutes can be generated from minute bars.

1 minute OHLC

Uses minute opening, high, low and closing points. It does not change the EA’s testing timeframe to M1.

Open prices only

Calls the EA at bar openings; W1/MN1 are simulated daily. Stop/pending results and timeframe access are restricted; Random Delay is unavailable.

These modes test different assumptions. A coarse result is not equivalent to a real-tick run. Choose a mode consistent with the EA’s logic and retain its name in the report.


Check preparation and the actual historical period

  1. Allow the required symbol history to synchronise. A multi-symbol strategy may pause while other history is loaded.

  2. Compare requested and actual dates in Journal. Insufficient pre-start data can shift the start forward.

  3. Retain that shift in the report; do not present the requested period as fully tested.

  4. Changing timeframe to shorten preparation changes the experiment. Check the EA’s design before comparing results from that different timeframe.


MT5: technical conditions that affect a test

The following MT5 tester behaviour must be distinguished from MT4 assumptions and from operation on a Live Account.

Condition

Testing behaviour

Spread

MT5 uses historical values as floating. If a historical value is zero or negative, the latest known value is used.

History before the test

Minimum history request: D1 and below, one year; W1, 100 bars; MN1, eight years (96 months). Missing preparation data can shift the actual start forward.

Multiple symbols

A new bar on one symbol does not guarantee a new bar on another. Opening-price-only testing needs particular attention to this synchronisation.

Simulated time

GMT, local and server time are equal inside the tester. This does not establish your Live server’s time zone.

Graphical objects

Objects are not drawn in non-visual testing/optimisation; their property queries return zero. This limitation does not apply to visual testing.

DLL calls

Remote agents prohibit DLL calls. Local agents require the corresponding import permission; permission alone does not establish that a program is trustworthy.

Do not enable DLL imports merely to make a test run. Establish the specific need and trusted program first; keep permissions unrelated to that need disabled.


Inspect an MT5 visual backtest

  1. After starting the visual test as described above, use the separate visualisation window. Its main chart uses the testing timeframe; choose that timeframe before starting because it cannot be changed inside this window.

  2. Read the chart's trade markers alongside its test prices. These show simulated activity, not trades or prices currently occurring in your Live account.

  3. Open View → Market Watch or press Ctrl+M to inspect the prices and current time within the simulation.

  4. Open View → Data Window or press Ctrl+D. Move the pointer over a bar to inspect its date, OHLC prices, spread, volume and indicator values.

  5. Open View → Toolbox or press Ctrl+T. Compare Trade for simulated positions and pending orders, History for orders and deals, Operations for EA requests, and Journal for testing logs.

  6. When investigating an unexpected action, match the simulated timestamp across the relevant request, execution and log entries. A requested operation and an executed deal are different records.


Troubleshoot an MT5 test that does not finish

  1. Read Journal chronologically. History preparation may download the main symbol and currency-conversion symbols; data preparation is different from an EA already running.

  2. An OnInit failure means the EA could not initialise. Check its inputs and the accompanying message; this is not evidence of a rejected live order.

  3. Memory errors, an array index outside its range and division by zero can terminate a test. Record the exact error and discuss it with the program developer rather than treating a partial report as a completed test.

  4. Compare the requested date range with the actual stopping point. Simulated Stop Out or the EA removing itself can end the run early. Keep the EA version, settings and relevant log messages with the report; an early end alone does not establish its cause.


MT5: Read the testing report fields

Compare these historical-simulation measures together. A high ratio alone does not establish future profitability.

Field

Interpretation

History Quality

Quality of the one-minute price data, including gaps; not the percentage of winning trades.

Profit Factor

Gross profit divided by gross loss; a value of one means they are equal.

Recovery Factor

Gained profit divided by maximum drawdown.

Sharpe Ratio

Return minus the risk-free rate, divided by return standard deviation. The tester assumes a zero risk-free rate.

Balance / Equity Drawdown

Absolute compares the initial deposit with the lowest value below it. Maximal measures the largest local peak-to-next-trough drop in currency; Relative measures that drop in percent. Check balance and equity separately.

Position holding time

Opening to complete closure. Partial closure and reversal do not count as complete closure for this measure.

Entry diagrams group openings, increases and reversals. Profit/loss diagrams group exits, including partial closures and reversals. Their hourly, weekday or monthly distributions describe the test; they do not identify a guaranteed profitable trading time.


Read the result in context

For example, a test that starts with 10,000 and ends with 12,000 shows a net gain in that simulation. It does not show how much the account fell along the way, how much capital was exposed or whether the result depended on only a few trades. Compare the equity curve, drawdown, trade count and distribution of results. These numbers are examples, not a return target or a recommended strategy.
​

A balance curve mainly reflects completed trades; an equity curve also reflects unrealised gains and losses. A smooth balance curve can therefore conceal substantial open-position losses. Check which curve and which drawdown measure the report uses before comparing two reports.


Check data and costs before comparing tests

Confirm the exact symbol, date range, data coverage, modelling method and cost assumptions. Spreads, commissions, swaps and execution delays can change results. Do not assume that every test includes all costs or reproduces current live execution. Missing data or a different price source can also change the sequence of trades.
​

Keep MT4 and MT5 tests separate. An MT4 EA and an MT5 EA are not automatically the same program; the platform, EA version and settings must match the report being reviewed. If a test produces no trades, inspect the test log, available data and EA inputs before concluding that the EA is faulty or that its strategy never trades.


Separate choosing parameters from checking them

If you repeatedly change parameters until one historical period looks good, that period is no longer an independent check. Reserve a different period before selecting parameters, and evaluate the selected settings there without tuning them to that period. Repeatedly choosing the best result can create an attractive historical report that does not generalise.
​

Keep a reproducible record: platform and EA version, symbol, period, initial test balance, parameter set, modelling method, costs and the report. Compare changes one at a time. A backtest, an optimisation result and subsequent demo operation answer different questions; none alone establishes that an EA is suitable for your circumstances or will make money.


Use the results responsibly

Review drawdown and the number of trades as well as profit. Keep a separate period that was not used to choose the settings, and compare performance there. Demo testing adds operating experience but still does not guarantee live results.

Keep the EA version, settings, test period and assumptions with the report so differences can be investigated. FXTRADING.com does not certify an EA’s profitability merely because it runs in MT4 or MT5. An EA cannot be installed or run in the FXTRADING.com App.

Did this answer your question?