Back to blog
Automation
AutomationOct 1, 2026 · 8 min read

How to Backtest an EA Properly

Key takeaways

  • Modelling quality decides whether the test is realistic. Real tick data exists only on MetaTrader 5 and only for the period your broker stored, and every other mode is interpolated.
  • Spread and commission must be set to what you actually pay, because a test at an unrealistic spread flatters every strategy.
  • A test that excludes a market regime is a test of the regime it included, not of the strategy.
  • Optimisation finds the settings that fit the past best, which is a different thing from settings that work next.
  • Read maximum drawdown and trade count before profit, because profit without those two is not a result.
  • A backtest cannot show you slippage, server downtime, or what you do under pressure, which is why demo running comes after it.

What a backtest can and cannot tell you

A backtest replays historical price data and shows what a set of rules would have done. That is genuinely useful for one purpose: finding out whether the logic is coherent and survivable, rather than whether it will make money.

What it cannot tell you is what happens next. Past prices are a single realised path out of many that were possible, and a strategy tuned to that path is tuned to something that will not repeat. The gap between a clean backtest and a live account is the subject of EA backtest against live results.

So run it to disqualify, not to confirm. A strategy that fails a careful backtest is almost certainly not worth live money. One that passes has earned a demo account, not a funded one.

The setup that makes a test meaningful

Four settings, and all four are commonly left wrong in the tests people post.

Modelling quality. MetaTrader 5 offers Every tick based on real ticks, Every tick, 1 minute OHLC, Open prices only and Math calculations. Real ticks is the only mode that is not interpolated, and only over the period your broker's tick history actually covers. MetaTrader 4 has no real tick mode at all, so an MT4 test of an intraday strategy is modelled price by definition.

Spread. Set it to what your broker actually charges, not to the tester default. A test run at one point of spread on an instrument that costs three will show a profit that does not exist, and the effect compounds with trade frequency.

Commission and swap are not tester inputs. They come from the symbol specification on your broker's server, so a test on a raw spread symbol that charges commission only includes it if that symbol's spec carries it. Otherwise build a custom symbol with your real costs, or subtract the cost per trade by hand before reading the result. A strategy with a thin edge and many trades lives or dies here.

Period. Long enough to include more than one market condition, and specifically to include the conditions that hurt. A test covering only a trending stretch tells you about trending stretches.

If you trade gold, run the test at the spread gold actually carries, which is wider than most pairs and widens further around news. Why that matters more on XAUUSD is in trading gold on a prop firm challenge.

  • Modelling: real tick data on anything that trades intraday.
  • Spread: what your broker charges, not the tester default.
  • Commission: included if your account type has one.
  • Period: long enough to include a condition that hurts.

Optimisation, and the trap inside it

The tester can try thousands of settings combinations and report the best. This is seductive and it is where most backtests become fiction.

The best performing combination over a historical period is, by definition, the one that fit that period most closely. Some of that fit is the strategy working and some is coincidence, and the tester cannot tell you which. Run enough combinations and you will always find one that looks exceptional, including for a strategy that has no edge at all.

The defence is simple and almost nobody applies it. Optimise on one period, then test the chosen settings on a different period the optimiser never saw. If the result collapses, the settings were fitted to noise. If it degrades but survives, you have something.

Be suspicious of any result that depends on a setting being exactly right. A strategy that only works at a stop of 37 points and fails at 35 and 40 has found a coincidence rather than a behaviour.

How to read the report

Three numbers before profit, in this order.

Maximum drawdown. Read the Equity Drawdown lines rather than the balance ones, because an open loser counts against a firm's limit while it is still open. And convert before comparing: the tester's relative drawdown is a percentage of its own peak, while your firm measures against the initial balance or a trailing high water mark, so the two are not the same measurement.

Trade count. Under roughly a hundred trades the result is noise regardless of how good it looks. Twenty profitable trades is a sample that a strategy with no edge produces regularly.

Then expected payoff, which is what the report calls expectancy and is already in account currency. Read it next to Total Trades and Profit Factor, and treat a profit factor much above two over a few hundred trades as a reason to re-check the modelling and the costs rather than as a result.

Only after those three does total profit mean anything. What each metric actually measures, and why win rate is near the bottom of the list, is in an eighty percent win rate can still lose the account.

What comes after the backtest

A backtest cannot model three things that decide live results, so the sequence after it is not optional.

It cannot model slippage and real fills, which is why a demo account on the same broker comes next. It cannot model the terminal being closed or the server dropping, which is why the next step after that is running it somewhere that stays on, covered in do you need a VPS. And it cannot model you, which is why the smallest live account available comes before any funded one.

If the destination is a prop firm account, there is a fourth step the tester knows nothing about: whether the settings respect that firm's limits and whether the firm permits automation at all. The checklist is in the rulebook checklist and prop firms that allow EAs.

Trading carries risk. A backtest that survives all of this is evidence the logic is coherent, not a projection of what any account will do.

Frequently asked questions

How do you backtest an EA properly?

Use real tick data on anything that trades intraday, set spread and commission to what your broker actually charges, and run a period long enough to include a market condition that hurts the strategy rather than only one that suits it.

Why do backtests look so much better than live results?

Usually a combination of unrealistic spread, no commission, modelling quality too low to represent intraday price, a period that excluded the hard conditions, and settings that were optimised to fit that exact history.

What is wrong with optimising an EA?

The best performing combination over a historical period is the one that fit that period most closely, and the tester cannot separate genuine behaviour from coincidence. The defence is to optimise on one period and then test those settings on a period the optimiser never saw.

What should I look at first in a backtest report?

Maximum drawdown, then trade count, then expectancy per trade in currency. Profit is the last number that matters, because a large profit over thirty trades with a forty percent drawdown is not a usable result.

How many trades does a backtest need to mean something?

Roughly a hundred as a floor for most approaches, and even then a single favourable market regime can carry the result. Twenty profitable trades is a sample that a strategy with no edge produces regularly.

Want the bot that runs this discipline for you?

PraxAIPraxAI™

The AI trading system that passes prop firm challenges and protects your funded accounts, hands free. Join 2,000+ traders running it today.

7-Day Money-Back
Secure Payment
Instant Delivery

Legal Disclaimer

PraxAI is not a broker and not a prop firm, and we do not open or provide trading accounts. Our software is not affiliated with, endorsed by, or sponsored by any of the prop firms named on this site; those names appear for compatibility reference only. Trading forex and leveraged products carries significant risk and is not suitable for every investor, so weigh your financial situation and risk tolerance carefully before trading. The bot and all material on this site are provided for educational and informational purposes only and do not constitute financial, investment, or trading advice. PraxAI is not a licensed financial advisor and does not provide advisory services.

Not Affiliated With Meta / Facebook

This site is not part of the Facebook or Meta websites and is not endorsed by Meta Platforms in any way. FACEBOOK is a trademark of Meta Platforms, Inc.

Earnings & Risk Disclaimer (U.S. Government Required)

Trading forex on margin offers large potential rewards but also a high level of risk. You must be aware of those risks and willing to accept them before trading the forex markets. Do not trade with money you cannot afford to lose. No representation is made that any account will, or is likely to, achieve profits or losses similar to anything discussed on this site. The past performance of any system or methodology is not necessarily indicative of future results.

CFTC Rule 4.41(b)(1) / NFA Rule 2-29

SIMULATED OR HYPOTHETICAL PERFORMANCE RESULTS HAVE INHERENT LIMITATIONS. UNLIKE AN ACTUAL TRACK RECORD, THESE RESULTS DO NOT REPRESENT REAL TRADING, AND BECAUSE THE TRADES WERE NOT ACTUALLY EXECUTED THEY MAY HAVE UNDER OR OVER COMPENSATED FOR MARKET FACTORS SUCH AS LACK OF LIQUIDITY. HYPOTHETICAL PROGRAMS ARE ALSO DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES LIKE THOSE SHOWN. IN PRACTICE THERE ARE OFTEN SHARP DIFFERENCES BETWEEN HYPOTHETICAL RESULTS AND THE ACTUAL RESULTS LATER ACHIEVED BY ANY TRADING PROGRAM. HYPOTHETICAL TRADING ALSO INVOLVES NO FINANCIAL RISK, AND NO HYPOTHETICAL RECORD CAN FULLY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK IN REAL TRADING.

Trading on a live account can lose real money, and the owners of PraxAI (praxai.io) cannot be held accountable for any losses that may occur, including losses arising from possible software bugs, glitches, or malfunctions.

PraxAI and its owners assume no responsibility for errors, inaccuracies, or omissions in these materials and do not warrant the accuracy or completeness of any information, text, graphics, links, or other items contained in them. PraxAI and its owners are not liable for any special, indirect, incidental, or consequential damages, including lost revenue or lost profits, that may result from these materials.

We assume you are legally permitted to purchase and use our products. Following the global and local laws and regulations that apply to you is your responsibility, and we cannot be held responsible for any damages or legal action against you arising from those regulations.

All information on this website, and any software or guide purchased from it, is for educational purposes only and is not intended as financial advice. Any statement about profit or income, express or implied, is not a guarantee. Your own trading may result in losses, as no trading system is guaranteed. You accept full responsibility for your actions, trades, and any profit or loss, and you agree to hold PraxAI (praxai.io) and any authorized distributors of this information harmless.

Important Notices

Risk of loss: forex trading carries a high level of risk and may result in the loss of your entire investment. No guarantees: past performance does not indicate future results, and there is no assurance you will achieve the same outcomes. Liability: we are not responsible for any losses incurred from using this bot, and by using it you agree to hold us harmless from any and all liabilities or damages. None of our services or information should be considered financial advice. All rights reserved. Using this website or its contents means you accept this disclaimer.

© 2025 PraxAI™ · All rights reserved.