Every EA developer will tell you their strategy is profitable. Backtesting is how you check if that's actually true — or if they just cherry-picked the best six months.
A backtest runs your EA against historical price data so you can see what would have happened if you'd been trading it for the past few years. No real money at risk. You get a report showing profit, drawdown, win rate, and a bunch of other numbers that either confirm the strategy works or tell you to keep looking.
The catch: backtests can lie. Or more accurately, you can set them up in ways that make a terrible strategy look great. This guide covers how to do it right.
Setting up a backtest on MT4
Open the Strategy Tester with Ctrl+R (or go to View > Strategy Tester).
Pick your EA and pair. Select the EA from the dropdown, then choose the currency pair or instrument it's designed for. Double-check the name — some brokers call gold "XAUUSD," others call it "Gold." If the names don't match, the EA won't load properly.
Choose the testing model. MT4 gives you three options:
- Every Tick — slowest, most accurate. Use this for your final test.
- Control Points — faster, less precise. Fine for a quick sanity check.
- Open Prices Only — fastest, least accurate. Only useful for strategies that trade on candle opens.
Always run the final backtest on Every Tick. The faster modes skip price movements within candles, which means they'll miss stop losses that would have been hit in real trading.
Set the date range. Check "Use Date" and set a range of at least 3–5 years. You want the test to include trending markets, ranging markets, and at least a couple of major events (COVID crash, 2022 rate hike cycle, etc.). A 3-month backtest is basically meaningless.
Adjust parameters. In EA Properties, set your starting balance and leverage to match what you'd actually trade with. If you plan to trade a $5,000 account with 1:100 leverage, test with those exact numbers. Testing with $100,000 and 1:500 will give you results that don't translate to your real situation.
Hit Start. If you checked "Visual Mode," you'll see the trades play out on the chart. Otherwise it runs in the background and finishes faster.
Setting up a backtest on MT5
Same shortcut: Ctrl+R. MT5's tester is better than MT4's in almost every way.
The big upgrade: MT5 supports "Every tick based on real ticks" mode. Instead of simulating tick data from candle prices (which is what MT4 does), MT5 downloads actual recorded tick data from the broker's server. This is as close to real market data as backtesting gets.
MT5 also handles data automatically — no need to manually download history files. Just select your pair, your time range, and the accuracy level. The platform pulls what it needs.
Another MT5 advantage: it can backtest multiple pairs simultaneously, which matters if your EA trades a basket or hedges across instruments.
Data quality matters more than you think
Your backtest is only as good as the data it runs on.
MT4's built-in data (from the History Center under Tools > History Center) typically gives you about 90% modeling quality. That sounds fine, but 90% means there are gaps. The data is reconstructed from 1-minute OHLC candles — it doesn't have real tick-by-tick price movement within each minute.
For strategies that trade on short timeframes (M1, M5) or use tight stops, those gaps change the results. We've tested the same EA with 90% quality data and 99%+ tick data, and seen profit differences of 15–30%. That's not a rounding error.
Your options for better data:
Use MT5. The real-tick mode gives you broker-recorded tick data with no extra setup. This is the easiest path to high-quality backtests.
Use a tick data tool on MT4. Tools like Tick Data Suite or Tick Data Manager import real tick-level data into MT4 and can push modeling quality above 99%. They also support variable spread simulation, which makes a big difference for scalping EAs.
Tip from our testing lab: If you're serious about backtesting on MT4, install a dedicated "clean" MT4 instance just for testing. Brokers sometimes overwrite your imported high-quality data with their own lower-quality feed when you connect. A separate install avoids that problem.
Reading the backtest report
After the test finishes, you get a report full of numbers. Here's what actually matters:
Net Profit — The total P&L. Obvious, but don't stop here. A strategy that made $50,000 but had a $40,000 drawdown along the way is not the same as one that made $20,000 with a $3,000 drawdown.
Maximum Drawdown — The biggest peak-to-trough drop in account equity. This is the number that tells you how much pain you'd have endured. Keep it under 20–30% for most strategies. If drawdown exceeds 50%, you'd need to double your remaining balance just to get back to breakeven. That's a hole most traders never climb out of.
Profit Factor — Total gross profit divided by total gross loss. Above 1.0 means the strategy is net profitable. Above 1.5 is solid. Above 2.0 is strong. If it's above 10, something is probably wrong — that kind of number usually signals overfitting.
Sharpe Ratio (MT5 only) — Measures return per unit of risk. Below 0 means the strategy lost money. Between 0 and 1 is mediocre. Above 1 is good. Above 3 is suspiciously good.
Win Rate — Percentage of trades that were profitable. Here's the thing most beginners get wrong: win rate alone is meaningless. A strategy with a 90% win rate that makes $10 per win but loses $200 per loss is a net loser. You need to look at win rate together with the average win/loss ratio.
Recovery Factor — Net profit divided by maximum drawdown. Above 1 means the strategy earned back more than its worst drawdown. The higher the better.
The right way to read a report: Don't fixate on any single number. We look at profit factor, drawdown, and recovery factor together. If all three are decent, the strategy is worth testing further. If one is incredible but the others are weak, something's off.
Where backtests go wrong
Overfitting
This is the big one. Overfitting means you've tweaked the EA's parameters until it fits the historical data perfectly — but it's memorizing noise, not learning real patterns.
How to spot it: split your data into two halves. Optimize the EA on the first half, then test it on the second half without changing anything. If performance drops by more than 50%, the strategy is overfit. Also watch out for hyper-specific parameters like "5.37 MA crossing 21.89 MA" — that level of precision is a red flag.
We build and test EAs daily, and we still catch ourselves overfitting sometimes. It's that easy to do.
Slippage isn't in the backtest
Backtests assume every order fills instantly at the exact price. Real trading doesn't work that way. During news events (NFP, rate decisions), slippage can hit several pips or more. For scalping EAs with tight stops, slippage alone can turn a profitable backtest into a losing live strategy.
Spread simulation is often wrong
Real spreads change constantly. They widen during low-liquidity periods (Asian session open, holidays) and around major news. If your backtest uses a fixed 1-pip spread but your broker's real spread averages 2.5 pips and spikes to 8 during NFP, the backtest is lying to you.
MT5's variable spread mode helps here. On MT4, set your fixed spread to something conservative — at least 1.5x what you see during normal hours.
The "future data" cheat
Some badly coded EAs reference data that wouldn't be available in real time — like using the closing price of a candle before it's actually closed. These EAs produce incredible backtests and terrible live results. Check if the EA has been reviewed or tested by independent sources.
Missing reality
Backtests don't simulate network delays, order rejections, partial fills, or requotes. These are all normal parts of live trading and they all cost you small amounts per trade that add up.
From backtest to live trading
Don't jump straight from a good backtest to real money. This transition is where most people mess up.
Out-of-sample test. Run the EA on a time period it was NOT optimized on. If it holds up, the strategy probably has real edge. If it falls apart, you overfitted.
Demo account for 1–3 months. Deploy the EA on a free demo account in real-time market conditions. Watch for: does the actual trade execution match the backtest? How does slippage affect results? How does it handle high-volatility events?
Small live account. After demo looks good, go live with money you can afford to lose completely. The jump from demo to live is bigger than people expect — the psychological pressure of watching real money draw down changes how you react. We wrote about this gap in detail here.
Scale up slowly. Only after 3–6 months of consistent live results should you consider increasing the account size.
The 7 backtest traps
-
Judging only by profit. A 200% annual return with 80% drawdown is worse than a 50% return with 15% drawdown. Always check risk metrics.
-
Testing too short a period. Two months of data doesn't tell you anything. The strategy might just be riding a favorable trend.
-
Ignoring costs. Spreads, commissions, and swap fees are real. High-frequency EAs are especially sensitive — adding realistic costs can flip a profitable curve to negative.
-
Over-optimizing parameters. If the only way to get good results is to set parameters to three decimal places, you're memorizing history, not discovering patterns. A robust strategy should work across a range of parameter values.
-
Too few trades. A report based on 30 trades isn't statistically meaningful. Aim for at least 200 trades before drawing conclusions.
-
Assuming perfect fills. If the EA logic says "buy at the open if the high touched X," that's achievable in a backtest but impossible in real trading.
-
Single-pair testing. If the EA claims to work on multiple pairs, test it on multiple pairs. Showing only the best-performing one is cherry-picking.
What to do next
If you're new to backtesting, start with what an EA actually is and then come back here. If you've run a backtest and the numbers look good, read about the gap between backtests and live trading before going live.
Every EA in the FXTool marketplace comes with full backtest data you can verify yourself. Download any EA and run it through your own Strategy Tester — we'd rather you verified than trusted.
About the author: The FXTool team builds and tests MetaTrader trading tools daily. We run every EA we sell on live accounts and publish the results. This guide reflects what we've learned from building 50+ EAs and working with thousands of retail traders.
Forex trading involves significant risk and may result in total loss of capital. This article is for educational purposes only and is not investment advice. Understand the risks and consider your financial situation before trading.