Why gold EAs pass the backtest and fail live
Short answer: A gold EA usually fails live for one of three reasons: it was tuned to one stretch of the past, its test left out real costs (spread, commission, slippage, swap), or its good result was luck. Judge it only on prices it wasn't tuned on, charge every cost and then double them, and test against luck before risking money.
Last checked: 10 October 2026.
Why does my EA make money in the backtest but lose live?
Because a backtest can be made to look good without anyone meaning to, and live trading removes each of the ways it was made to look good.
- The past. The rules were tuned until history fitted. New prices don't follow the same noise.
- Costs. The test charged less than a real account pays, or nothing at all.
- Luck. Among many settings or many ideas, one will shine by accident.
The gap can be large. One seller's backtest showed a 3% maximum drawdown; its live account later showed 27%.
Is my gold EA overfit to the past?
It is overfit if its good result depends on one exact setting or one good stretch of time.
Overfitting: tuning a strategy's rules and settings until they fit past prices so closely that they describe that history's noise rather than a lasting pattern. It looks great in the backtest and fades on new prices.
What does overfitting look like on gold?
Two signs show up most often. The optimisation report has one sharp peak: a single setting makes money and its neighbours don't. Or one good year carries the whole result while the other years lose or drift. BaroqTech's tests check the second sign directly: at least 5 of 8 judged half-years must be profitable, and the largest half-year may carry no more than half of all profit.
What is out-of-sample and walk-forward testing?
Out-of-sample / walk-forward: out-of-sample means judging a strategy on prices it was not tuned on. Walk-forward repeats this in steps: tune on one window, judge on the next unseen window, move forward, repeat.
BaroqTech uses gold against the US dollar in five-minute steps from January 2020 to December 2025. An idea may choose its settings on two years of prices, then it is judged on the following six months, which it has never seen. The window moves forward half a year and the whole thing is repeated, eight times, covering 2022 to 2025. Only the judged half-years count. Prices from 2026 are kept apart for one last check. The full rules are on the method page.
Do nearby settings also work?
They should. If a moving-average period of 20 works and 19 and 21 don't, you have found a number, not a pattern. BaroqTech's rule: at least 6 in 10 nearby settings must also work, to guard against "one magic number".
How much do costs change a gold EA's result?
Enough to turn a winner into a loser. An edge that only survives cheap trading is not an edge.
What are spread, commission, slippage and swap on XAUUSD?
Spread: the gap between the buy (ask) and sell (bid) price, paid on every trade. It widens at rollover and around news.
Commission: the broker's fee per trade, charged on many raw-spread accounts.
Slippage: the difference between the price an order expected and the price it was filled at. On gold it grows around news and thin hours.
Swap: the overnight financing charged or paid for holding a position past the daily rollover. On MT5 it is often tripled on Wednesday nights.
On BaroqTech's tests, every trade pays the spread, the commission and slippage, and pays financing for each night it is held, three nights' worth on Wednesdays. Together that is roughly 0.013% of the trade's value for getting in and out.
What happens if costs double?
Run the test again with every cost doubled. A strategy whose result collapses is living on thin margins that a wider spread, a slower fill or a different broker will take away. BaroqTech's rule: the score must stay at 0.50 or higher with costs doubled.
Which MT5 Strategy Tester settings matter?
The tick model, the execution delay and the commission settings change results the most. Read MetaQuotes' own pages rather than a summary: Strategy Testing and Real and Generated Ticks in the MetaTrader 5 Help.
How can I tell luck from skill in a backtest?
Compare the result with what chance alone would produce, and raise the bar for every idea you try.
What is a shuffle (Monte Carlo) test?
A shuffle test compares the real result with copies of itself in which the timing of the trades is shuffled at random. If the real timing doesn't beat nearly every shuffled copy, the profit came from gold rising, not from when the trades were placed. BaroqTech's rule: the timing must beat 99% of 2,000 shuffled copies of itself.
Why does testing many ideas raise the bar?
Test enough ideas and one will look good by accident. So the bar has to account for every idea tried, not just the one you are looking at. BaroqTech's rule: 95% confidence after allowing for every idea ever tested. Every new test raises the bar for all the others.
Can a score above the pass mark still fail?
Yes. The score is only one of nine tests.
Case: New York opening-range breakout. Score 1.01 against a pass mark of 1.00, on 448 trades, tested 8 October 2026. Turned down: "Cannot be told apart from luck." The score is the yearly return divided by how much it swings, after all trading costs, on prices the idea had never seen. A score over the mark with a result that luck could explain is not a pass. Source: the record.
Are there enough trades to judge?
Not if the test has fewer than about 200 trades in the period that is judged. A handful of trades can look like anything.
Case: Daily momentum. 46 trades in the test, score 0.73, tested 7 October 2026. Turned down: "Too few trades to judge" and six more reasons. Source: the record.
How long should I demo-test an EA before going live?
Long enough to see at least thirty closed trades over at least three weeks, and to compare them with what the test promised.
BaroqTech's order of steps: lab, then judge, then demo account, then live account; a strategy that stops earning goes back a step.
On the demo account a strategy needs thirty closed trades over at least three weeks, earning no less than half of what the test promised. Only then does it go to a live account: small size, a stop on every trade, a daily loss limit, and a floor that switches it off. A strategy that stops earning goes back a step. Nothing is deleted.
Results from a test or from a demo account do not predict results on a real account.
A 10-minute checklist for any gold EA backtest
| Check | Why | Where to look in MT5 |
|---|---|---|
| Real ticks, not generated ones | Generated ticks can hide fills inside the bar | Strategy Tester settings: modelling |
| Commission and swap charged | Costs decide most thin strategies | Tester settings and the symbol's specification |
| A test with costs doubled | Shows how thin the margin is | Rerun with a wider spread and higher commission |
| Out-of-sample period | Judges on prices the EA was not tuned on | Forward testing option, or your own date split |
| Neighbouring settings | Rules out one magic number | Optimisation results around the chosen setting |
| Results by year or half-year | One good stretch carrying the rest | Report, or export trades and group by date |
| 200 or more trades in the judged period | Fewer can look like anything | Report: total trades |
| Equity drawdown, not only balance | Open losses count | Report: equity drawdown |
| A live record next to the backtest | The gap shows what the test missed | See how to verify a gold EA's track record |
What do BaroqTech's own tests show?
No strategy has passed yet; every result is public at baroqtech.com/record.
Each idea is listed with its score, the test it failed and the date. The research log shows every run of the judge, including ideas judged again after a fix.
Case: Moving-average pullback with a VWAP filter. Score 0.29, tested 7 October 2026. Turned down: "Score below the pass mark" and six more reasons.
Case: never switched on. Some ideas never got to trade in the test: in no two-year training stretch did any setting make money, so they were never allowed to trade on the judged prices.
Said openly, as the record says: one prop-firm challenge account of BaroqTech's own runs the New York opening-range breakout as a forward test. It has not passed, it is not an offer, and its result will be published either way.
BaroqTech is also building the desk, a planned read-only dashboard for MetaTrader 5 that gives every robot, strategy and signal channel the same verdict, with costs inside every number.
Join the waiting list: we email you when the desk opens. Updates are optional, and every email has an unsubscribe link. baroqtech.com
FAQ
Why does my EA work in the backtest but not live?
Usually for one of three reasons: the settings were tuned to one stretch of past prices, the test charged less in costs than a real account pays, or the result was luck. Live trading removes all three. Judge on unseen prices, double the costs, and compare the result with shuffled copies of itself.
How do I test an EA on MT5 properly?
Use real ticks, charge commission and swap, and keep a period the EA was not tuned on for judging. Rerun with costs doubled, check neighbouring settings, and count the trades in the judged period. Read the MetaTrader 5 Help on strategy testing for each setting rather than relying on defaults.
How do I know if a gold EA is overfit?
Look for a single sharp peak in the optimisation results, where nearby settings fail, and for one good year carrying the rest. Then judge it on prices it was not tuned on. An overfit EA looks strong in the period it was tuned on and weak in the period it never saw.
What is walk-forward analysis in MT5?
Walk-forward analysis tunes a strategy on one window of prices, judges it on the next window it has not seen, then moves both windows forward and repeats. BaroqTech tunes on two years, judges the next six months, and repeats this eight times. Only the judged periods count towards the result.
How much do spread, slippage and swap matter on XAUUSD?
Enough to decide whether a thin strategy makes or loses money. Spread and slippage widen around news and rollover, and swap is often tripled on Wednesday nights. A useful check is to rerun the test with every cost doubled and see whether the result holds.
How many trades does a backtest need before it means anything?
More than most reports show. BaroqTech asks for 200 or more trades in the judged period before a result counts. For reading a live record, under thirty trades over three weeks is too early to say anything at all.
How long should I demo-test a gold EA before going live?
At least thirty closed trades over at least three weeks, and compare them with what the test promised. BaroqTech asks for no less than half of the tested result before a small live account. Results from a test or from a demo account do not predict results on a real account.
BaroqTech makes software. It is not investment advice and it does not manage money. Trading leveraged products such as gold CFDs carries a high risk of losing money, and you can lose all of it. Results from a test or from a demo account do not predict results on a real account.