Backtesting guide
Configure an Expert Advisor test in the MT5 backtester
MT5 Strategy Tester runs an Expert Advisor on historical data. This guide covers manually configuring an automated EA test, not a discretionary click-to-trade replay tool. Preserve the selected program, data, model and account assumptions before interpreting the result.
Read the practical guideKey Takeaways
- Start with a saved baseline before searching parameter combinations.
- Distinguish generated ticks, available real ticks and simplified price modes.
- A historical forward partition is not a live demo-account observation.
How to backtest an EA on MT5
Compile the Expert Advisor in MetaEditor, open Strategy Tester in the desktop terminal, choose the EA and symbol, set the timeframe and date range, select the tick-generation or modeling mode, configure deposits and account conditions, and save the input set. Run a baseline before optimization so later changes have a comparison point.
- Preserve the EA source or build version and input file.
- Record symbol specification, dates, modeling mode, and account settings.
- Inspect trades, graph, drawdown, and forward results where used.
Use modeling and delay settings deliberately
MetaTrader documents several tick-generation modes and warns that rougher modes are intended for faster preliminary checks. It also provides delay, commission, account, optimization, and forward-testing settings. Match the mode to the EA logic and preserve it with the report. Every tick and Every tick based on real ticks are different choices; verify actual data coverage. Profit calculation in pips omits swap, commission and margin control, so label it as a rough estimate.
Keep the forward partition independent
The Forward setting reserves a later part of the selected historical window for evaluating selected parameters. It is still a historical simulation. Repeatedly changing rules after viewing that partition uses it for development; keep a fresh evaluation window and record each candidate tried. A separate demo observation examines the frozen EA on newly arriving data.
Do not plan on mobile Strategy Tester
The official MetaTrader 5 Android guide documents quotes, charts, trading, and account history but does not document Strategy Tester. Based on that current guide, plan to compile and backtest an EA in the desktop terminal. Verify the official mobile documentation again if MetaQuotes adds the feature later.
Direct Pineify workflow
Generate the EA source, then test it in MT5
MQL5 AI Coding Agent can create or revise editable Expert Advisor source from an explicit specification. Compile and test that source inside MetaTrader 5.
Create or revise MQL5 Expert Advisor source before the desktop Strategy Tester workflow.
Generate the MQL5 EA sourceBoundary: Pineify does not open MetaTrader, compile inside your terminal, access broker data, run Strategy Tester, optimize the EA, or produce an MT5 backtest report.
Primary sources
- MetaTrader 5 Help: How to Test a Trading RobotVerified 2026-10-20
- MetaTrader 5 Help: Mobile Trading for AndroidVerified 2026-10-20
This page is educational and does not provide investment advice. Backtests are hypothetical, depend on their data and assumptions, and do not guarantee future results. Trading can result in substantial loss.