MetaTrader 5

Backtesting on MetaTrader 5

Short guide: run your first MT5 backtest

This walkthrough shows how to open the Strategy Tester, pick your Expert Advisor (EA) or indicator, set parameters and data, and review results.

If you don’t see the Strategy Tester, you’ll need to enable it first. It’s hidden by default in many installations.

1) Open the Strategy Tester

  1. In MT5, go to View → Strategy Tester (or press Ctrl+R).
  2. The Strategy Tester panel appears (usually docked at the bottom). If it’s floating, you can drag it to dock.

If the panel still doesn’t appear, make sure you’re in the MT5 terminal (not MetaEditor). The Strategy Tester is part of the terminal.

2) Select what to test

In the Strategy Tester, choose the tested object and basic parameters:

  • Tested object: select your Expert Advisor (EA). If you’re evaluating an indicator, choose Indicator (where supported) or use an EA that applies the indicator logic for backtesting.
  • Symbol & timeframe: pick the market (e.g., EURUSD) and timeframe (e.g., H1).
  • Date range: set the period you want to test.
  • Model: Every tick (most precise) or 1-minute OHLC/Every tick based on real ticks if available.
  • Deposit & currency: optional but useful for money‑management metrics.
  • Visualization: turn on if you want to watch trades play out on a chart in real time.

Ensure your EA or indicator is compiled with no errors in MetaEditor (F4 → Compile). Otherwise, it won’t appear or won’t run in the tester.

3) Configure inputs

Click Inputs (or Inputs/Parameters tab) to set your EA/indicator parameters:

  • Set lot size, risk, or any strategy variables.
  • Leave Optimization off for a single backtest run. Enable later if you want to search for best parameters.

Start simple: run a single backtest first to validate behavior. Then iterate with different inputs or enable optimization.

4) Run the backtest

  1. Click Start to begin.
  2. If Visualization is enabled, a chart window opens showing orders/positions in real time during the test.
  3. When finished, review the tabs:
    • Results: list of trades and operations
    • Graph: equity/balance curves
    • Report: summary stats (profit factor, drawdown, etc.)
    • Journal: logs and error messages

If the test runs instantly with no trades, check that your EA trading conditions can actually trigger within the chosen symbol/timeframe/date range.

5) Data considerations

Backtests depend on data quality. If you need higher‑quality tick data, see the separate guide: Getting MT5 tick data.

Troubleshooting

  • Strategy Tester not visible: View → Strategy Tester; ensure you are in MT5 terminal, not MetaEditor.
  • EA not listed: recompile in MetaEditor; confirm it’s an Expert Advisor placed under MQL5/Experts.
  • No trades: widen the date range, change timeframe, verify inputs, and check Journal for errors.
  • Sluggish visual mode: turn off Visualization or reduce the speed slider.

Next steps

  • Iterate inputs and compare reports.
  • Try Optimization to search parameter combinations.
  • Move from demo to live only after robust testing and risk checks.