A profitable backtest blows a real account when the test saw an easier market than the account will: in our own work a tick dataset that silently lost 19% of trading hours turned 3 account blow-ups into 1 at the same deposit, a time-zone slip made a losing idea look profitable in 7 of 7 quarters, and a reserve the model rated at about one blow-up in 19 months was stopped out live within a week.

Lessons from our research and our model on past ticks, not a forecast and not advice. Trading with leverage carries risk: if the deposit is too small, a stop-out is possible.
See also: 7 protections for a martingale grid bot on gold →
On this page (10)
What does "the backtest lied" actually mean?
A backtest replays an expert advisor (EA) on past prices and reports what it would have earned. It does not lie on purpose; it answers exactly the question it was given. When a real account later loses, the test was usually given one of six wrong inputs: missing prices, costs that were too low, information from the future, a lucky period, settings fitted to that period, or a simulator that trades differently from the EA.
For a grid or martingale EA the gap is wider than for other robots. A grid earns small amounts often and loses rarely but a lot, so its result depends on the few worst hours of the test. Remove a handful of those hours, and the backtest shows a smooth line where the account would have ended.
The six reasons at a glance
| Reason | What the test sees | What the account sees | Our own example |
|---|---|---|---|
| Holes in tick data | Hours with no prices are skipped | Every hour, including the violent ones | 19% of hours lost; blow-ups 1 instead of 3 |
| Costs: spread, slippage, swap | A constant small spread, no swap | Wider spread at rollover and news, swap every night | A locked account stopped out by spread alone |
| Look-ahead bias | Prices that were not known yet | Only the past | 5-hour time-zone slip: fake profit in 7 of 7 quarters |
| Cherry-picked or survivor period | The period that looks best | Whatever comes next | The best of 80 variants looks good partly by chance |
| Overfitting | Settings tuned to the test's own path | A different path | Results that vanish when a setting moves slightly |
| Model is not live | The simulator's rules | The broker's fills and the EA's timing | Entries checked once a minute: half the deep baskets |
1. Holes in the tick data
What happens. A tick backtest is only as complete as its data. If an hour is missing, the EA never sees the move inside it: the price simply jumps to the next available tick. For a grid that is the worst possible gap, because a fast one-way hour is exactly what fills a basket to the last order.
Our own lesson. Our first gold dataset was assembled by a downloader that, after a few failed requests, silently stored an hour as "empty". It lost 1,859 of 9,864 hourly slots — 19% of ordinary weekday hours, spread across all sessions, plus every Sunday-evening reopen. Nothing looked wrong: the equity curve was smooth. When we re-downloaded the missing hours and ran the same settings again, the number of account blow-ups rose at every deposit level we tested:
| Deposit per 0.01 lot | Blow-ups on the data with holes | Blow-ups on complete data |
|---|---|---|
| $500 | 6 | 11 |
| $705 | 3 | 5 |
| $900 | 1 | 3 |
| $1,000 | 1 | 2 |
Our model, about 19 months of XAUUSD ticks, the same grid settings in both columns. The point is the direction, not the exact counts.
How to check yours. Count ticks or one-minute bars per hour and look for weekday hours with zero. In MT5 use the mode "Every tick based on real ticks" and check that the history for the whole period is downloaded. More: how to backtest a gold EA on real ticks.
2. Costs the test did not charge: spread, slippage, swap
What happens. Most backtests use a fixed or historical average spread and no slippage. On gold the spread widens sharply at the daily rollover, at the Sunday open and around news. A grid opens many orders exactly in fast markets, and every order pays the spread of that moment. Swap is charged on every position held past rollover, three times on the triple-swap day, and a basket that stays open for days pays it on all its lots.
Our own lesson. A small MT5 account with a locked basket (buy and sell of equal size) looked "safe from stop-out" because a lock does not lose when price moves. It was stopped out anyway: when the spread widened, both legs were valued worse at once and the small equity ran out. Since then we never write "no liquidation" for a lock.
How to check yours. Re-run the test with a wider spread (for example double the usual one) and see whether the result survives. Our basket break-even with commission and swap shows how far each cost moves the exit of a basket.
3. Look-ahead bias: the test used prices from the future
What happens. Look-ahead bias is when a strategy decides with information that did not exist yet at that moment. It rarely looks like cheating; it hides in time stamps.
Our own lesson, twice.
- A time-zone slip. Session boundaries were converted with a "naive" date (no time zone) on a computer that was not in UTC, so every session ended 5 hours earlier than in reality. The strategy traded the high and low of a session that had not finished yet. It showed about +$12 a day per lot, was positive in 7 of 7 quarters and passed a holdout year. All of it was fake. The tell-tale: 269 of 269 trades had the next 30 minutes moving in the trade's favour. Real edges never look like 100%.
- A bar time stamp. One-minute bars were labelled with the start of the minute. A signal on the close of a bar was then "entered" at the first tick of the same bar — 60 seconds before the signal existed. It produced an "84% chance of continuation". Shifting the entry one minute later made it vanish.
How to check yours. If a result looks too good on gold, first count how often price moved in the trade's direction right after the entry. Then delay every entry by one bar: a real effect weakens gradually; a look-ahead effect disappears.
4. Cherry-picked periods and survivors
What happens. A backtest shown in an advert starts and ends where it looks best. A grid that survived 2025 may simply not have met its worst hour yet: in our data, 16 of the 25 widest gold hours of January 2025 – October 2026 fell between 28 January and 2 February 2026, including a fall of $314.21 in one hour. A test that ends before that week is a different test.
Survivorship is the same effect across products: you see the EAs and the accounts that are still alive. The ones that blew up stop being advertised.
Our own lesson. When we tested 80 variants of one family of window-and-pending-order strategies, the best one looked good. But choosing the best of 80 is itself a fit to the data: part of its edge is the luck of being chosen.
How to check yours. Test the whole available history, not a chosen year, and include the hardest stretches on purpose: see the stress test of a grid EA on real ticks.
5. Overfitting: settings tuned to one path of prices
What happens. Overfitting means the settings were adjusted until they fit the past exactly: a step that just avoided the worst day, an order cap that happened to stop one order before disaster. The next path of prices is different, and the fit is gone.
Signs. The result changes a lot when one setting moves a little; the best settings are an isolated peak, not a plateau; many settings were tried and only the best is reported; the strategy has more rules than the test has bad days.
How to check yours. Move each setting one notch in each direction. If the account survives only at the exact value, it is a fit, not a margin. In our own research we judge a grid by its neighbourhood: a change of step, order cap or deposit that helps must also help at the neighbouring values.
6. The model is not the live EA
What happens. Even with perfect data and costs, the simulator has to decide when an order opens, at what price and how often the EA checks the market. Small differences here change how deep baskets go, and depth is what blows a grid.
Our own lesson. Our first engine checked the entry once a minute, on the close of the bar, while the live EA checks every tick. That alone gave half as many deep baskets as the live account. After we rebuilt the engine to follow the EA tick by tick, baskets of 7 or more orders over the same 13 days were 69 in the model against 66 live. Before that fix, a deposit per 0.01 lot that the model rated at about one blow-up in 19 months was stopped out on a live account within about a week. That is why we call model numbers "in our model" and never "safe".
How to check yours. Compare a few live days with the model on the same ticks: number of baskets, how many reached 7 or more orders, and the deepest one. If the model has fewer deep baskets, its blow-up count is optimistic too.
How to test a grid EA honestly
- Complete real ticks for the whole history, with no empty weekday hours. In MT5: "Every tick based on real ticks".
- Realistic costs: your broker's spread including rollover, commission, swap; then a second run with a wider spread.
- No future in the signal: decisions only on closed bars, entries strictly after the signal time.
- The whole history plus the hardest stretches, not a chosen year.
- Neighbouring settings: the result must survive one notch of change.
- Arithmetic first: before any test, know how far gold must move against the first order to reach stop-out. With $1,000, 0.01, ×2, step $1.95 and 11 orders it is $65.58; a backtest cannot make that number bigger (why grid EAs blow gold accounts).
- A forward demo with the same broker and settings for several weeks, compared with the model on the same days.
The free Midas Grid emulator replays real gold ticks since January 2025 day by day, so steps 1, 4 and 5 take minutes. It is still a model: a constant spread, no slippage, and the past will not repeat in the same order.
FAQ
Why does my EA work in the backtest but lose on a live account?
Usually the test saw an easier market than the account: missing ticks, a spread that was too small, no swap, information from the future, a lucky period or settings tuned to that period. For a grid EA a few missing fast hours are enough, because the result depends on the worst hours.
Is "Every tick based on real ticks" in MT5 enough?
It removes the guesswork of generated ticks, but only for the history your broker actually provides, with that broker's spread. Check that the whole period is downloaded and that weekday hours are not empty, then add a run with a wider spread.
How long should a grid EA backtest be?
Long enough to include the worst moves of the market you trade. For gold that means at least the full history since January 2025, including 28 January – 2 February 2026, when 16 of the 25 widest hours of that period happened. A short test that misses them measures a calmer market.
What is look-ahead bias, in one sentence?
It is a backtest using a price that was not known at the moment of the decision, usually through a time-zone or bar-timestamp mistake; the quick check is to delay every entry by one bar and see whether the profit disappears.
Can a forward demo replace a backtest?
No, they answer different questions. A few weeks of demo show how your broker fills orders and charges costs; a long backtest shows whether the settings survive the rare bad hours a short demo will probably not meet. Use both, plus the stop-out arithmetic.