You have a trading idea. It looks great on a few charts. But will it work over 500 trades? That is what forex backtesting on MT5 helps you find out, without risking a single dollar.
This MT5 tutorial walks you through the Strategy Tester, the best settings, and a simple calculator to read your results.
How to Backtest a Forex Strategy on MT5
- Open MetaTrader 5 and press Ctrl+R to open the Strategy Tester.
- Select an Expert Advisor (EA) or indicator that follows your rules.
- Choose the symbol, timeframe and date range.
- Set the modelling to Every tick based on real ticks for the best accuracy.
- Click Start and review the Results, Graph and Backtest tabs.
What Is Backtesting in Forex?
Backtesting means running your strategy on past market data to see how it would have performed. You apply fixed rules for entry, exit and risk, then measure the result.
It is not a guarantee of future profit. But it helps you remove weak ideas early and build confidence in good ones.
Why Use the MT5 Strategy Tester?
The MT5 strategy tester is built into MetaTrader 5, so you do not need extra software. It supports:
- Multi-currency testing
- Real tick data from the broker’s servers
- Visual mode to watch trades unfold
- Optimisation to compare parameter settings
- Multi-core and cloud testing for speed
For beginners, it is one of the best reasons to use the MT5 trading platform.
Before You Start: Write Down Your Rules
A strategy needs clear, testable rules. For example:
- Entry: Buy when the 20 EMA crosses above the 50 EMA on the H1 chart.
- Exit: Stop loss 30 pips, take profit 60 pips.
- Risk: 1% of the account per trade.
If you cannot write the rules in a few lines, the strategy is too vague to test.
Step-by-Step: How to Backtest a Forex Strategy on MT5
Step 1: Open the Strategy Tester. Go to View → Strategy Tester, or press Ctrl+R.
Step 2: Pick your Expert Advisor. Choose a built-in sample EA, an EA from the MetaTrader Market, or one coded for your rules. No coding skills? Start with a simple built-in moving average EA to learn the process.
Step 3: Choose symbol and timeframe. For example, EUR/USD on H1.
Step 4: Set the date range. Use at least 2–5 years, including trending and ranging periods.
Step 5: Choose the modelling type. Select Every tick based on real ticks for accuracy. Use Every tick or 1 minute OHLC for faster, rougher tests.
Step 6: Set deposit and leverage. Match the account you plan to trade, for example $1,000 with 1:100 leverage.
Step 7: Run the test. Click Start. Turn on Visualization if you want to watch each trade.
Step 8: Study the report. Open the Backtest tab and check the key numbers below.
Simple Backtest Results Calculator
These quick formulas help you judge a result.
- Win rate = Winning trades ÷ Total trades × 100
- Profit factor = Gross profit ÷ Gross loss (above 1.3 is often considered decent)
- Average risk-reward = Average win ÷ Average loss
- Expectancy = (Win rate × Average win) − (Loss rate × Average loss)
- Max drawdown = Largest drop from a peak in equity
Example:
- 200 trades, 90 wins, 110 losses
- Win rate = 90 ÷ 200 = 45%
- Average win = $60, average loss = $30
- Expectancy = (0.45 × 60) − (0.55 × 30) = 27 − 16.5 = $10.50 per trade
- Over 200 trades: about $2,100 before costs
A 45% win rate can still be profitable when winners are twice the size of losers. Always subtract spread, commission and slippage.
How to Test Forex Strategy Settings: What to Check
- Total trades: At least 100–200 trades for a meaningful sample.
- Drawdown: Can you emotionally handle the worst losing period?
- Profit factor: Consistent, not just one big winning trade.
- Equity curve: Smooth and steady is better than wild swings.
- Costs: Use realistic spreads and commissions from your account type.
Automated Backtesting on MT5: Optimisation Basics
Automated backtesting MT5 lets the tester try many parameter values, like different moving average lengths. This is called optimisation.
Be careful. If you tune too hard, the strategy fits the past perfectly but fails live. This is called overfitting. To reduce the risk:
- Keep the number of parameters small.
- Test on data the strategy has not seen (out-of-sample).
- Run a forward test on a demo account.
Common Backtesting Mistakes
- Using too little data or only one market condition
- Ignoring spreads, commissions and slippage
- Cherry-picking the best period
- Changing rules after seeing the results
- Trusting a backtest without a demo forward test
Benefits and Limits of Backtesting
Benefits: saves time, removes emotion, shows risk before real money is at stake.
Limits: past data is not the future, and real execution may include slippage and requotes. Treat backtesting as the first step, not the last.
Expert Tips
- Keep a testing journal with settings and results.
- Test one change at a time.
- Always follow with at least 4–8 weeks of demo trading before going live.
Frequently Asked Questions
1. How do I backtest a forex strategy on MT5?
Open the Strategy Tester with Ctrl+R, choose your Expert Advisor, symbol, timeframe and date range, set modelling to real ticks, then click Start. Review the Backtest and Graph tabs for profit factor, drawdown and win rate before trusting the results.
2. Is MT5 backtesting accurate?
It can be quite accurate when you use real tick data and realistic spreads and commissions. However, it cannot predict future markets or show every real-life slippage event. Use it as a guide and confirm results with a demo forward test.
3. Can I backtest manual strategies on MT5?
Yes, but it is harder. You can use Visual mode to watch the market replay and trade manually in the tester, or code your rules into an EA. Many beginners start with a simple EA to keep testing consistent.
4. How much historical data do I need?
Use enough data to cover different market conditions, usually 2 to 5 years or more. Also aim for at least 100 to 200 trades. A small sample can look great by chance and mislead you.
5. What is a good profit factor in a backtest?
A profit factor above 1.3 is often seen as decent, and above 1.5 as strong, but context matters. Check drawdown, number of trades and costs too, because a high profit factor on a tiny sample is not reliable.
Conclusion
Forex backtesting on MT5 helps you replace guesses with evidence. Write clear rules, test on enough data, include real costs and confirm on a demo account.
Ready to test your first strategy? Open the MT5 platform with an eonefx demo account and run your first Strategy Tester session today.