Desk Notes

The Backtest That Died When I Added Commissions

Average gross edge of 0.28% per trade. Average round trip cost of 0.31%. Everything else in the simulation was decoration.

Written and edited by Ryza Glorioso. How we use AI

4 min read

A dark laptop screen showing a faint white equity curve drawn over a fine grid
Photo by Chris Liverani on Unsplash

A strategy with turnover lives or dies on one comparison. Everything else in the output is decoration. Average gross return of a single trade. Round trip cost of a single trade. If the first number is smaller, no amount of annualized performance on a gross curve will fix it, because the gross curve is the thing that has been mispriced.

Mine was smaller. Here is the arithmetic that established it, in the order I ran it.

Four lines, forty minutes

Short term mean reversion across a universe of a few hundred names, two or three day holds, roughly nine hundred round trips a year. The gross equity curve sloped up. Drawdowns were shallow enough to be comfortable. That is the sort of picture that makes you stop asking questions.

Average gross return per trade: 0.28%. That is thin. It should be. A small per trade edge repeated nine hundred times compounds into something that looks spectacular before costs.

Crossing the spread came first. The screen favoured smaller names, where reversion is sharper. The average spread on that universe was around 0.22% of price. Taking liquidity at both ends pays roughly the full spread over the round trip. So 0.22% comes straight off.

Commissions were the smallest line. At the share sizes I was modelling, entry and exit together were about 0.04% of position value.

Slippage was the line I had been avoiding. The simulation filled at the closing price on the day the signal fired, which is a price I could not have received, because the signal was computed from that close. Filling at the next open instead and measuring the difference across the sample added about 0.05%.

0.22 + 0.04 + 0.05 = 0.31% per round trip, against a gross edge of 0.28%.

Three basis points of loss per trade. Nine hundred times a year. If each trade uses the full account, and mine roughly did, 0.0003 x 900 = 0.27, which is twenty seven percentage points of capital handed away annually for the privilege of running the system.

Why I did not see it coming

Partly because gross curves are emotionally persuasive and cost lines are dull, and I had put the costs at the bottom of the output where I had stopped reading.

Mostly because I had chosen the universe without thinking about what the choice implied. Reversion is stronger in less liquid names. Less liquid names have wider spreads. Those two sentences describe one fact from two sides, and my screen was selecting for the thing that produced the edge and the thing that consumed it in the same filter. The strategy was expensive by construction. That construction was the part I had been proud of.

The fill assumption was the other error. It is the most common way a backtest flatters itself. Filling at the close of the signal bar assumes something impossible. You knew the closing price before the close. Correcting it is unglamorous and it moves results more than most parameter tuning does. If you want the mechanics of why the spread exists and who on the other side is paying close attention to precisely this, market makers and liquidity covers it.

What I have, and what I do not have

I moved the universe up in liquidity, accepting a weaker signal for spreads that cost a fraction of what the small caps charged, and I lengthened the hold from two days to about two weeks, which cuts the number of round trips so the same edge per trade covers the same cost across fewer payments. The version that came out has a thinner gross curve. The net one is much better. When reversion works and when it becomes catching a falling knife is covered honestly in mean reversion trading.

I also rewrote the simulator so costs are the default. There is no flag to turn them off, and the cost lines print at the top of the output above the returns, in the same font, because anything at the bottom of a report is something I will eventually stop reading.

What I have not done is establish that the slower version works. I have established that the fast one did not, and those are different findings. The slower version has fewer trades, which means fewer observations, which means a wider band around every estimate I have of its edge, and the honest statement is that I cannot yet distinguish it from noise at the sample size I have. I notice that I want to treat the two findings as one. The first felt like rigour, and rigour is pleasant.

The broader version of this problem, where a stable statistical relationship survives a spreadsheet and disappears in an account, runs through pairs trading and statistical arbitrage. The sizing question that follows once you believe you have a net edge, and the penalty for being wrong about its size, is worked through in the Kelly criterion and position sizing.

Frequently asked questions

Why do high turnover strategies fail once costs are included?

Costs are charged per trade while the edge is also earned per trade, so the comparison that matters is the average gross return of one trade against the round trip cost of one trade. A strategy with a small edge and hundreds of trades a year can look excellent gross and lose money net.

What costs should a realistic backtest include?

Commissions in both directions, the cost of crossing the bid ask spread on entry and exit, and slippage between the price your simulation assumed and the price a real order would have received. Short positions also carry borrow fees, and taxable accounts face a further drag the simulation will not show.

How do I estimate the spread cost of a strategy?

Take the average bid ask spread of the instruments the strategy selects as a percentage of price, and assume you pay roughly the full spread over a round trip if you are taking liquidity at both ends. Screens that favour smaller or less liquid names produce a much larger number than the index names most people picture.