TITLE: Why Your Backtest Spread Is Lying to You
Every backtest runs on a spread. Almost nobody checks whether that spread is the one you will actually pay. This is the cheapest lie in algorithmic trading, and it is also the most expensive one to believe, because it inflates results without ever throwing an error. Your equity curve looks clean, your profit factor looks healthy, and the whole thing collapses the week you go live.
This article is about measuring that gap honestly, and about the three places where the number in your tester diverges from the number in your account.
## The spread setting you never chose
The strategy tester does not invent a spread out of nowhere. It takes one from the symbol specification of the server you are connected to, then applies the model you selected. When you run on a demo account with a raw-spread broker at 03:00 server time, you get a number that looks wonderful. When you run the same EA at 15:30 on a live account during a news release, you get something else entirely.
Two consequences follow, and both are easy to miss.
First, the tester uses the spread that was stored in the history at the moment the bar was formed, not the spread you would have received at the exact second your order was sent. If your EA enters at market on bar open, the difference between the stored spread and the real one at that instant is pure sampling noise that always seems to favor you.
Second, the default model in many testers applies a fixed or a "current" spread. Fixed spread is a fiction: it removes exactly the variability that kills scalpers. Current spread is a different fiction: it applies today's calm number to last year's headlines.
## What a gold spread actually costs
Let me put numbers on this. On XAUUSD, one point is 0.01. A spread of 25 points is 0.25 in price. With a 0.10 lot position, the tick value is roughly one dollar per point, so 25 points of spread is about 2.50 dollars per round trip. That sounds small. Now run the arithmetic that matters.
A scalping system that trades four times a day on a 10,000 dollar account with 0.10 lots pays 4 x 2.50 = 10 dollars a day in spread, or roughly 200 dollars a month. That is two percent of the account per month handed over before a single losing trade. If the strategy's edge is 2.2 percent per month, the spread eats almost all of it. At 40 points, which is what you see on gold during London open on a retail account, the monthly cost becomes about 320 dollars and the edge is gone. The strategy did not stop working. The cost doubled.
This is why the same EA can be a legend on one broker and a disaster on another, with identical code and identical signals. Nobody changed the strategy. The spread changed.
## The three places the lie hides
The first is the average spread. If you evaluate your EA by its total profit, you are measuring the average effect of a distribution. But position sizing and stop placement interact with the tails of that distribution. A trade that opens during a 90-point spread spike does not cost 90 points: it costs 90 points multiplied by your lot size, and if the spike is followed by a stop-out, it costs the stop plus the spread. Averaging hides this because the spike is rare. Rare and expensive is precisely the shape of an account-ending event.
The second is the assumption that spread is symmetric. It is not. On many brokers the ask moves away from you faster than the bid, so the effective entry price is worse than the mid plus half the quoted spread. If your backtester only subtracts a fixed spread per trade, it undercounts the cost of entering into momentum.
The third is commission blindness. Raw-spread accounts quote a tight spread and charge a commission per lot. A backtest that models only the spread will love these accounts. The same backtest that adds the commission will discover that a system trading 40 round trips a week with a 7 dollar per lot commission is paying more in commission than in spread. Both numbers need to be in the model at the same time, because they move in opposite directions when you choose a broker.
## How to stop lying to yourself
There is a straightforward procedure that costs one afternoon and permanently changes how you read your results.
Run the same EA three times on the same history, changing only the spread: your recorded spread, the recorded spread plus 50 percent, and the recorded spread plus 100 percent. Plot net profit against spread. A robust system degrades gracefully. A fragile one falls off a cliff between the first and second run. The shape of that curve, not the number at the left end, is the useful output. If doubling the spread turns a 4.0 profit factor into 0.9, you have not found a strategy; you have found a spread arbitrage that will be taken from you within a month.
Then repeat the test with the spread applied asymmetrically. If your tester supports a custom commission, add it and re-run. The goal is not to reproduce one exact broker. The goal is to find the region of parameter space where the system still works, and then ask whether your broker sits inside that region.
Finally, compare the modelled spread against real tick data for the same period. This is the step almost everyone skips, and it is the only one that uses information the tester did not have. Export ticks for a representative week, compute the distribution of spread at the exact moments your EA would have entered, and compare it to what the tester charged you. When the difference is systematic rather than random, you have found a modelling error, not bad luck.
## Where the tick data changes the answer
There is a particular pattern worth looking for: strategies whose entries cluster at the top of a bar rather than at its open. These include breakouts, pullback entries that trigger on a micro retest, and anything that reacts to a new high. At the exact moment of a breakout, the spread widens because the liquidity that was resting just above the level disappears. A backtest on one-minute bars with a fixed spread cannot see this. A tick-based backtest can, and it usually turns a profitable breakout strategy into a marginal one.
The same logic applies to your exits. Trailing stops and break-even moves are executed at exactly the moment when everyone else is doing the same thing. The spread at that moment is the worst spread of the day. If your tester charges the average, your exits are systematically free.
## A practical checklist
Before you trust another equity curve, confirm all of the following.
The spread model is stated explicitly, including whether it is fixed, current, or taken from history. Commission is modelled separately and in the right units. You have run the 1.5x and 2x spread tests and can describe the shape of the degradation. The trade count is high enough that the spread cost is not a rounding error. The entry timing of the strategy has been checked against tick data at least once. And the broker whose spread you used is the broker you will trade with, at the session time you will actually trade.
None of this makes a strategy profitable. It only stops you from adopting a strategy that was never profitable in the first place.
## The uncomfortable conclusion
A backtest is not a prediction. It is a consistency check between your idea and your data. The spread is the part of that data most often replaced by an assumption, and assumptions are exactly where a tester quietly flatters you.
The good news is that this is fixable without any new software. Set the spread deliberately, stress it, add commission, and look at the failure mode instead of the headline number. If the system survives a doubled spread and a realistic commission, you have learned something true about it. If it does not, you have just saved yourself the tuition fee.


