The Fill Model Is Where Backtests Quietly Cheat
Every backtest has to answer a boring question: when the strategy says "buy," what price does it actually get? Most backtesting frameworks answer this question badly by default, and the badness is almost always in the strategy's favor. Here are the four assumptions that do the most damage, roughly in order of how often they show up. Mid-price fills If your backtest fills orders at the midpoint of…
Backtesting is a crucial step in evaluating trading strategies, but it can often be misleading due to the way trades are assumed to be filled. Four common assumptions in backtesting significantly skew results in favor of the strategy. Firstly, assuming mid-price fills implies trading for free, which is far from reality as real trades incur spread costs.
Secondly, assuming zero slippage overlooks the fact that markets react to trades, causing prices to move. Thirdly, assuming unlimited execution size at the touch ignores the fact that large orders disrupt the order book. Lastly, omitting or averaging out commissions and fees can drastically underestimate the impact of trading costs.
For instance, a mean-reversion strategy with a 2-cent spread, a 55% win rate, and an average win of 18¢ and a loss of 14¢ per share, would see its 3.6¢ per share expectancy drop to 1.6¢ when actual spread costs are considered. However, from a CSV of closed trades alone, it's challenging to fully validate execution realism, especially when it comes to order book mechanics.
Instead, a simple test using average win and loss figures adjusted for full spread costs on both entry and exit can provide a preliminary check. If the strategy no longer shows positive expectancy after this adjustment, it indicates that the edge was largely due to favorable fill models rather than a genuine signal.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.