Cost Stress Test for Gold EAs: What Wider Spreads and Slippage Do to an XAUUSD Robot
Gold starts December after a third straight monthly loss. Spot fell to about 3,446 USD on 25 November, finished the month down roughly 6%, and was trading around 3,650 USD on Tuesday 1 December. The US dollar index touched a 20-month high on Monday, the US 10-year yield is just under 5%, and markets see a Fed rate hike at the 8-9 December meeting as very likely. The November payrolls report is due on Friday 4 December.
Weeks like this are when trading costs matter. Spreads widen around data releases and stops fill worse in fast moves. So the question for this post is simple: how much extra cost can a gold EA take before its edge disappears? Here is the stress test I ran on GoldRush Pro Xauusd, the trend-following XAUUSD H4 EA I develop, and how you can run the same test on any EA.
What I tested
The base is the same backtest as in my earlier posts: XAUUSD H4, 1 January 2024 to 20 November 2026, every tick based on real ticks (FBS), each preset at its recommended starting balance. Because it runs on real ticks, the broker's recorded spread is already in the results. On top of that I charged an extra cost per ounce on every entry and on every exit:
- +0.20 USD per ounce: a somewhat more expensive broker, or normal slippage.
- +0.50 USD per ounce: a clearly wider spread, or regular slippage on volatile days.
- +1.00 USD per ounce: the harsh case. Charged on entry and exit, that is 2.00 USD per ounce on every round trip.
To put that in money: if your broker's contract is 100 ounces per lot (check the contract specification), +1.00 USD per ounce is 100 USD per lot when a position opens and another 100 USD when it closes.
Balanced at three cost levels
I ran all three levels on the Balanced preset (15,000 USD start). Its profit factor went from 1.32 in the plain backtest to 1.29 at +0.20, 1.25 at +0.50 and 1.19 at +1.00 USD per ounce.
The decline is close to a straight line: every extra 0.10 USD per ounce takes a little more than 0.01 off the profit factor. Even at +1.00, Balanced still makes more on its winning trades than it loses on its losing ones. What changes is the margin. At 1.19 there is much less room for a bad year.
All seven presets at +1.00 USD per ounce
| Preset | Start (USD) | Profit factor, backtest | Profit factor, +1.00 USD/oz | Change |
|---|---|---|---|---|
| Conservative | 20,000 | 1.23 | 1.11 | -0.12 |
| Small Account | 5,000 | 1.39 | 1.25 | -0.14 |
| Balanced | 15,000 | 1.32 | 1.19 | -0.13 |
| Aggressive | 10,000 | 1.35 | 1.22 | -0.13 |
| High | 7,000 | 1.34 | 1.22 | -0.12 |
| Very High | 3,500 | 1.20 | 1.10 | -0.10 |
| Extreme | 2,000 | 1.22 | 1.13 | -0.09 |
Every preset stayed profitable. Three things stand out.
- The hit is similar everywhere, so the starting margin decides where you end up. All presets run the same strategy, so the profit factor fell by a similar 0.09 to 0.14. Conservative (1.23), Very High (1.20) and Extreme (1.22) started with the thinnest margin and finished closest to 1.00: at 1.11, 1.10 and 1.13.
- Conservative is not the cost-safe choice. Low risk per trade keeps the drawdown small, but it does not make the edge bigger. Conservative made only +2.0% in 2024 before any extra cost, so on an expensive broker it can spend long stretches going nowhere. If you plan to use it on a prop-firm account, check your broker's gold spread first.
- Very High and Extreme get hit twice. They have the lowest profit factors of the seven and by far the deepest drawdowns (43.92% and 56.35% worst equity drawdown in the backtest). Extra cost eats into an already thin edge. I would not run either preset with a broker that has wide gold spreads.
Small Account kept the highest profit factor (1.25), but it lost 0.8% in 2024, and higher costs would make a year like that worse.
Why an H4 trend follower can absorb costs
Cost hurts in proportion to what a trade is trying to make. GoldRush trades H4 in the direction of the daily trend, with a stop loss and take profit on every entry, one position per signal and no grid, martingale or averaging. Its stops and targets are sized for H4 swings, so a 2 USD round trip is a modest slice of each trade.
An EA that scalps a few dollars per ounce per trade is in a very different position: the same round trip can be most of its target. That is why a cost test is the first thing I would ask for on any gold scalper. The same logic sits behind two of GoldRush's filters: it checks the spread before it enters, and it stays out during a window around the NFP release, when gold spreads tend to widen. Friday's payrolls report is exactly that kind of moment.
What this test cannot tell you
- It charges the same cost on every trade. Real costs bunch up around news and in thin hours, which is also when stops get hit.
- It does not model weekend gaps. When gold opens on Monday far from Friday's close, a stop can fill well past its level, and that loss can be bigger than any fixed cost in this test.
- It is still a backtest on one broker's ticks. Forward results from my demo account will get their own post.
How to run a cost stress test on any gold EA
- Backtest on real ticks so a real spread is included, and save the report.
- Export the deals. For every entry and every exit, subtract: extra cost per ounce x lots x ounces per lot.
- Recalculate the profit factor and the drawdown at +0.20, +0.50 and +1.00 USD per ounce.
- Inside MetaTrader 5, also run the tester with a random execution delay instead of ideal execution, to see how fills change.
- Compare your own broker's gold spread with the one in the test, both in a quiet hour and around a news release.
Red flags: the profit factor slides toward 1.00 already at +0.20 USD per ounce, or the seller only shows results with zero spread or ideal execution. That EA is living on perfect fills, not on its signals. Run a cost test alongside the mirror test I described earlier.
GoldRush Pro Xauusd is available on the MQL5 Market: GoldRush Pro Xauusd.
All results are backtests on historical data. Trading gold on margin carries a high level of risk and past results do not guarantee future results.


