You probably never learned how to backtest correctly and minimize the risk of distorted backtest results. Let's dive into the art of backtesting like a pro.
Most retail backtests don't match live trading. You might run a backtest and the strategy looks profitable in the tester. You open a demo account and deploy the strategy, the numbers add up. You have confidence in your strategy and you put it on a live trading account. Three months in and you're equity curve slopes down while your backtest shows it would go up. The reason might be an overfitted strategy, but if that's not the case you have to dive deeper to find the real reason. It's a handful of configuration mistakes that silently distort what the backtest measures. This article covers what you need to align between backtest and live, the practical setup that works best in testing, and the irreducible gap you should expect even after doing everything right.
There are 5 parameters that can have an influence on the outcome of your backtest, regardless of your strategy settings. These should all be taken very seriously because they can all add up to huge differences in the outcomes of your tests, especially when they are stacked.
1. Risk per trade. This may sound obvious, but you will see that for some assets, the risk per trade doesn't align with what you expect it to be. For example, when you set a 1% risk per trade, somewhere along your backtests your trades result in a higher or lower risk per trade than the set 1%. This is because in your backtests, the lotsize calculations are derived using the current tick values. Tick values are derived based on the price of an asset. If an asset has gained, let's say 50%, in a period of 10 years, your backtest risk per trades will be way off at the start of your backtest. This has a massive effect on your strategy performance if you have a trading management style that is based on floating profits expressed in money or as a % of account balance/equity. The best fix is to adjust your trade management styles so they measure floating profits in terms of pips or relative to the entry/stop loss price rather than based on money or percentage gains. Sadly, it is not possible to fix the size issue, unless you test in small samples and keep changing the tick value in yourcustom symbol settings.
2. Swap. Swap is what you pay or receive on your position when you hold it overnight. Every broker sets a swap rate based on the interbank rates for the currencies you are trading, often with an added fee pocketed by the broker itself. The thing is, swap rates are updated daily and can vary quite a lot over time. However, if you backtest on a Metatrader Terminal from a broker that you don't use for your live trading, then you will never see the impact of the realistic swap rates on your test. If you use imported tickdata with custom symbols, you can adjust the swap rates manually. The best practice here is to always check if your swap rates, match the rates quoted by the broker you use for your live trading.
3. Tick data quality. "100% history quality" in the strategy tester doesn't mean the data file is complete. Verify the bar count and tick count after import. You can do this by checking the download source and verifying this with the bars and ticks displayed in your backtest report.
4. The tick data source. You will find there are big differences in tick data sources and this results in different outcomes for your trading results. The best practice is to use tick data from the broker that you use for live trading. If this is not possible, choose one source and stick to it for all your backtests to keep it consistent.
5. Clocks and timezones. Make sure to align the timefilters in your EA with the market watch time of the broker terminal where you are testing. Brokers can use different timezones for displaying the time in the Metatrader terminal and you have to make sure to align your EA settings properly with this timezone. Always verify with your local time.
The simplest setup that approximates live well:
Log into your live broker's MT5 terminal and run the Strategy Tester against the broker's native symbol. Don't use a custom symbol, don't use imported tick data, and don't change anything in the symbol specifications and backtest configurations.
This works because a live broker account handles all 5 parameters in a backtest like you would experience them in a live environment, if you were to use this same broker to trade live with.
-Dynamically computed TickValue. The broker's MT5 calculates SYMBOL_TRADE_TICK_VALUE from the current quote on every tick. Lot sizing tracks live execution. Custom symbols don't get this, their TickValue is a static stored value that drifts as the quote currency moves (covered later).
-The broker's actual swap rates built in, not demo defaults (which can be off by 2-3×)
-The broker's actual margin requirements, contract size, and lot size calculations are all built in
-The broker's own tick history when you select "Every tick based on real ticks" in the Strategy Tester.
From our own tests, this setup produced trade-by-trade accuracy as good as any third-party tick data import. Importing Dukascopy tick data into a custom symbol with imported symbol specifications gave identical results, but added complexity and introduced the static-TickValue problem. There's no reason to use the more complex setup if the broker's native data works.
Step 1: Install your live broker's MT5 terminal (the one you trade on, or a demo from thesame broker; same build, same data).
Step 2: Let MT5 download the broker's tick history for the period you want to test. In MT5 go to Tools → Options → Charts, set "Max bars in chart" and "Max bars in history" to large values. Open the symbol chart and scroll back to confirm data exists for your full target period. Brokers typically retain 1-2 years of real ticks, if you need more you need to import tick data yourself.
Step 3: Run the EA in the Strategy Tester against the broker's native symbol with "Every tick based on real ticks" modeling mode selected. This tells the tester to use the broker's actual tick data rather than simulated ticks.
Step 4: Verify realized risk per trade. Look at the first five losing trades: loss ÷ starting_balance should equal your EA's risk % parameter within ±10%. If it's off, something else is wrong (a bug in your EA or a wrong input parameter) but it won't be a spec or TickValue issue, because the broker's native symbol is the source of truth.
Sometimes you need more than your broker's terminal provides. The main reasons:
-The broker's history is too short. Most brokers retain only 1-2 years of real tick data. If you want to backtest a strategy over 5-10 years, you need an external source like Dukascopy.
-You want a consistent reference dataset. For example, comparing the same strategy against multiple broker conditions over the same period.
Let me show you how you actually import tick data in your MT5 terminal.
1. Get Dukascopy tick data for your symbol and period. There are several sources where you can download this for free.
2. On your live broker's MT5 terminal, create a custom symbol using the native symbol as a template (Symbols → Select Forex -> Select the symbol -> CreateCustom Symbol → Copy From: your broker's USDJPY → Change the name to something like USDJPY.TICK). This copies all the specifications from the native symbol such as swap, margin requirements, and trading hours.
3. Load the Dukascopy ticks into the custom symbol by selecting the new custom symbol “USDJPY.TICK → Go to the “ticks” tab at the top → ''Import ticks.”
4. Run the EA. Verify realized risk per trade the same way as above. Doing this on your live broker's terminal (rather than a third-party demo) keeps everything in one place and avoids any chance of the imported specifications not matching the live broker exactly, except for tick value which remains static. The "Copy From" step is the cleanest way to get the broker's specifications in a custom symbol.
When the stop loss management rules of your EA are based on a dollar amount, distorted tick values can lead to serious discrepancies. For example, if your EA moves the stop loss to breakeven once the floating profit reaches $100, the price movement needed to reach that $100 depends entirely on the lot size. As we explained earlier, the lot size depends on the tick value. If the tick value doesn't match the the true tick value at the time and price of entry, the lot size can be off. With a bigger lot size, the trade needs fewer pips of profit before the rule is triggered. With a smaller lot size, the trade needs more pips before the same dollar profit is reached.
So if your backtest is using a lot size that is 30% bigger than your live trading lot size, the trailing or breakeven rule will trigger much earlier in the backtest. In practical terms, the backtest only needs about 77% of the price movement that the live EA would need to trigger the same rule. This means that some trades which would not have reached breakeven in live trading may still be protected in the backtest. As a result, trades that would have been losses live can become breakeven trades or even winners in the backtest. This can make the backtest look better than it really is, especially by inflating the win rate.
The first thing to check is whether the realized risk in the backtest matches the intended risk. If the lot size is wrong, the profit and loss numbers are wrong by that same factor, and the win/loss distribution may also be biased. The better solution is to base trailing stops and stop management rules on what the market does, such as price movement, pips, ATR, or structure, instead of basing them on how much floating profit the account is showing.
The honest truth is that you will always experience some sort of discrepancy between your backtest trades and your live trades. But,when the configuration is right, most trades match live closely.
Again, these are the steps you need to take in order to get the most accurate and correct backtest results:
1. Use your live broker's MT5 terminal directly.
2. Run Strategy Tester against the broker's native symbol with "Every tick based on real ticks" mode.
3. Verify the date range covers your full live period.
4. Verify realized risk on the first 5 losing trades by checking if they match your EA's risk parameter. If they don't, take the tick value problem in consideration.
Only import external tick data (e.g. Dukascopy) when you need longer history than your broker provides or want a consistent dataset across multiple brokers.
Dive into a world of knowledge, trends, and industry updates on the Variable blog. Our curated content covers a spectrum of topics.