Skip to content

How to analyse a backtest

A profitable backtest does not mean a profitable EA. Go through these steps before you trade a strategy with real money. The numbers are explained in Read your backtest results and the tables in Orders and deals.

Look at Total trades in the report. With 15 trades, a few lucky ones decide the result. Aim for at least 100 trades, spread over the whole period. Too few trades? Test a longer period, or check whether your Open Buy and Open Sell signals are too strict.

  • Profit factor above 1.3, and
  • Expected payoff clearly higher than the costs of one trade (spread plus commission).

If the expected payoff is only a few pips, a slightly higher spread at your broker can turn the strategy into a losing one. Run the same backtest with a higher spread to see how sensitive it is.

Compare the maximal drawdown with the total net profit (the recovery factor) and with what you can bear. A strategy that makes 40% but had a drawdown of 35% on the way will be hard to keep running in real life. In MT5, look at the equity drawdown: it includes the losses of trades that were open.

4. Does the result depend on a few trades?

Section titled “4. Does the result depend on a few trades?”

Open the Orders (MT4) or Deals (MT5) tab and click Profit to sort the biggest winners first. Compare the largest profit trade with the total net profit. If one or two trades make most of the profit, the result is luck rather than a strategy. Sort the other way to look at the biggest losers: what happened there?

Expand a few trades and read the Comment: sl (stop loss), tp (take profit), or closed by your EA. If most trades end at the stop loss, look at your Stop loss distance and your entry signals. If winners hardly ever reach the take profit, a Trailing stop loss or a closer Take profit may work better. In MT4, modify rows show how often a trailing stop moved the stop loss.

Add up the Commission and Swap columns. For a scalper the commission can be larger than the profit. A strategy that holds trades for days pays (or earns) swap every night. Make sure your backtest uses the commission and spread of your own broker; see Run a backtest.

7. Can your money management survive the losing streaks?

Section titled “7. Can your money management survive the losing streaks?”

Look at Maximum consecutive losses. With a Martingale the lot size doubles after every loss: 8 losses in a row means a lot size 256 times the first one. With Fixed risk of 2% per trade, 10 losses in a row cost about 18% of the account. Make sure the account can survive at least twice the longest streak in the backtest.

A strategy that only works in one period is probably tuned (overfitted) to that period.

  • Test a different period: optimise on one year, then test on the next year without changing anything.
  • Test other symbols with similar behaviour.
  • Compare long and short trades in the report: if only one side makes money, the profit may just be the trend of that period.
  • Test with the most accurate test model (“Every tick based on real ticks” in MT5).
  • Be wary of many parameters with very precise values. The fewer settings a strategy needs, the more likely it keeps working.

Click Recover expert advisor to get the EA exactly as it was tested, change one thing, and run a new backtest. Change one setting at a time, so you know what made the difference. Browse between backtests with the arrows at the top of the result page to compare them.

CheckWhereRule of thumb
Enough tradesReport: Total trades100 or more
Edge after costsReport: Profit factor, Expected payoffProfit factor above 1.3; expected payoff well above spread + commission
DrawdownOverview: Max drawdown; Report: Equity drawdownOne you can live with; recovery factor above 2
No outliersOrders/Deals sorted by ProfitLargest profit trade is a small part of total net profit
ExitsComment columnYou know which exit drives the result
CostsCommission and Swap columnsStrategy stays profitable with a higher spread
Losing streaksReport: Maximum consecutive lossesAccount survives twice the longest streak
RobustnessNew backtestsProfitable in other periods and symbols

MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.