Backtesting Realism: Why Friction and Slippage Decide Your Edge
The most dangerous number in quantitative trading is a backtest return that assumes perfect fills. A strategy can show a beautiful equity curve and still lose money in production for one boring reason: friction. Getting backtesting realism right — modeling slippage, spread, commission, and fill timing honestly — is what separates a strategy with a real edge from a curve-fit illusion that evaporates on contact with a live market.
The great backtest lie
A large share of published backtests assume you filled every order at the exact price printed on the chart. Nobody fills at the open. Nobody fills at the close. Between your signal and your fill, reality intrudes:
- The signal fires; it takes time to construct and send the order — the market has already moved a tick or two.
- Your broker routes the order; another tick can slip.
- You cross the spread. Half-spread is a fraction of a tick on the most liquid names, several ticks on thinner ones.
- Commission takes its cut, one to a few ticks depending on tier.
Add it up and total friction is easily several ticks. On an instrument with a modest daily range, that can be 20–50% of your edge gone before the position is even live. A strategy whose backtested edge is smaller than its friction is not a strategy; it is a fee-generation machine for your broker.
How LuckMa models friction
LuckMa's replay engine is deliberately pessimistic, because an optimistic backtest is worse than none — it gives you false confidence. The friction model includes:
- Slippage and half-spread applied on both entry and exit, drawn from the replay configuration group.
- Commission per trade, at a realistic API tier.
- Volatility-aware spreads — friction widens on choppy, high-range candles, exactly where naive backtests are most optimistic.
- Worst-case intrabar ordering — when a candle could have hit both your stop and your target, the engine assumes the adverse one happened first.
Every closed trade also carries its maximum adverse and favorable excursion (MAE/MFE) in observed market prices, so you can see not just whether a trade won, but how much heat it took first. We calibrate the model per instrument and separate signal quality from execution drag with a zero-friction counterfactual — if a strategy only works at zero friction, it does not work.
The goal is not a prettier equity curve. It is a backtest that, when you go live, does not surprise you — because the friction was already in the number.
Realism is a governance property, too
Conservative, reproducible measurement is also what lets an adoption decision be trusted. LuckMa's both-cohort adoption rule and session-level significance testing only mean something if the underlying numbers are honest about costs. Realistic friction is the foundation the shadow → adoption-gate ladder stands on.
Conclusion
Teams that model friction honestly deploy only the strategies with real edge — and they do not blow up three months into live trading discovering the costs they ignored. Backtesting realism is not pessimism for its own sake; it is the difference between measuring an edge and imagining one.