Saved in this browser only.
In this tutorial
Before you start
- MetaTrader 5 with the EA installed — see How to Install an Expert Advisor in MT5.
- The EA's recommended symbol, timeframe and
.setfile. - Time for the tester to download history the first time (it can take a while for long periods).
What you'll learn
- Configure a backtest that resembles your real trading conditions.
- Read the key statistics and the equity graph.
- Recognise results that are too good to trust.
Steps
Step 1: Open the Strategy Tester
Choose View → Strategy Tester (Ctrl+R). The tester opens as a panel with several tabs, starting with Settings.
Step 2: Choose the EA, symbol and timeframe
Select your Expert Advisor, then the symbol and timeframe given in its documentation.
Step 3: Set a meaningful date range
Pick a custom period long enough to include different conditions — trends, ranges and volatile spells — rather than just the last few months. Leave Forward off for a first test.
Step 4: Pick the modelling mode
For EAs that act within a bar, choose Every tick based on real ticks when your broker provides tick history — the most detailed mode, and the one that uses recorded spreads. Open prices only is much faster but only valid for EAs that trade on a new bar.
Step 5: Match your account
Set Deposit and Leverage to what you'll actually trade with. Under Delays, choose a non-zero execution delay rather than ideal execution to make fills more realistic.
Step 6: Load the inputs
On the Inputs tab, right-click and load the developer's
.setfile or your own, and keep Optimization disabled for this run.Step 7: Start the test
Click Start. When it finishes, open the Backtest tab for the report and the Graph tab for the balance and equity curves.
Step 8: Read the report
Look at these together, never profit alone:
- Total net profit — meaningless without the drawdown beside it.
- Maximum drawdown (balance and equity) — could you sit through it with real money?
- Profit factor — gross profit ÷ gross loss.
- Total trades — very few trades make every other number unreliable.
- Largest loss trade — can a single trade do serious damage?
Step 9: Check costs and the equity curve
Scroll the deals in the report to confirm commission was charged if your broker charges it — if not, live results will be worse. On the graph, a smooth rising line with sudden deep drops often means grid or martingale risk.
Don't run an optimisation and keep the single best result: those settings are usually fitted to past noise. Prefer settings that work reasonably across a range of values, and test them on a period you didn't optimise on.
Expected result
A completed report and graph for your EA on realistic settings, with the net profit read alongside maximum drawdown, trade count and costs — and a clear idea of whether it's worth a demo forward test.
Troubleshooting
- "No history" or the test ends immediately
- Let the tester download data and try again, or choose a period your broker has history for.
- No trades at all
- Check the Journal tab of the tester for errors, confirm the symbol name matches what the EA expects, and that its filters (spread, hours) can be met.
- Results differ every time with real ticks
- Random execution delays change fills slightly between runs. Use the same delay setting when comparing configurations.
- Licensed EA won't run in the tester
- WebRequest-based license checks can't run in the Strategy Tester. Check the developer's instructions for testing.
Official documentation
Next tutorial
How to Test a Forex Bot on a Demo Account
Forward test an Expert Advisor on a demo account: open a demo, mirror your real settings, keep a simple log and compare results with the backtest.
Continue