MT5 Strategy Tester: How to Backtest Expert Advisors and Strategies

The MT5 Strategy Tester evaluates MQL5 programs using historical data and a selected simulation model. Its output describes that experiment; data availability, execution assumptions, and program behavior determine what the results can support.

Key Takeaways

  • Generated Every tick and Every tick based on real ticks are different modes.
  • Open prices only still processes hidden control ticks for stops and pending orders.
  • Genetic optimization samples the search space; a forward split does not eliminate selection bias.
  • Pineify can assist source drafting; run and inspect MT5 tests in the target terminal.

Choose the model by the decisions the EA makes

Every tick generates ticks from minute history; Every tick based on real ticks uses available broker tick history subject to tester data rules. One-minute OHLC uses minute control points. Open prices only calls OnTick at the selected bar openings, but hidden control ticks still process stop orders and other checks. It does not simply ignore stop losses. An H1 chart alone does not make coarse modeling suitable for intrabar entry or trailing rules.

Record a reproducible test setup

Open Strategy Tester with Ctrl+R, select the compiled EA, symbol, period, dates, model, and inputs. Record the broker/server, terminal and source version, account configuration, history coverage, costs, and execution-delay settings used. Inspect the available settings and report: no single Symbol Settings tab guarantees realistic spread, commission, and slippage. Check missing data, dependencies, permissions, and Journal messages before interpreting results.

Separate optimization from evaluation

Define input ranges and the objective before comparing runs. Complete optimization enumerates the selected combinations; genetic optimization samples them and need not find the global best. MT5 forward evaluation separates a later period from optimization, but repeated selection using that period compromises its independence. A rolling walk-forward study requires repeated windows and an explicit selection procedure; one built-in forward split is not that whole process.

Read trade-level evidence alongside metrics

Check position sizes, timestamps, fills, costs, and balance versus equity drawdowns. Profit factor, Sharpe ratio, and trade count describe different aspects of the run. There is no universal profit-factor, drawdown, or sample-count threshold that certifies an EA for live use. A smoother historical curve may still reflect overfitting or incomplete execution assumptions.

Test indicators and live-event behavior separately

MT5 supports visual indicator testing. An EA using a custom indicator must obtain its handle and read the intended buffers with readiness and count checks. A monitored demo run can expose connection, restart, and broker-response behavior not reproduced by the historical model. A fixed four-week period does not certify deployment readiness. Pineify helps draft MQL5 source; inspect compilation diagnostics and run the actual EA in MT5. Its TradingView CSV reports are not an MT5 report importer.

This page is for informational purposes only and does not constitute investment advice. Trading forex and CFDs on MT5 carries substantial risk of loss. Past performance does not guarantee future results. Always consult a qualified financial advisor before making trading decisions.

Frequently Asked Questions