All articles
Backtesting

Why Most Backtests Lie

Anurag Singh Kushwah·May 12, 2024·12 min read

Every trader I've worked with has a folder of strategies that looked brilliant in a backtest and lost money the first month they went live. After four years of building and operating a full-stack trading platform, I've come to a simple conclusion: most backtests don't fail because the strategy is bad. They fail because the simulation was never honest in the first place.

The fill assumption nobody questions

The most common lie in a backtest is the fill. A naive engine fills your order at the close of the signal candle, at full size, with no slippage. Live markets don't work that way. Your order arrives late, walks the book, and moves the price against you — especially in the mid-cap names where most retail edges supposedly live.

When I rebuilt my backtesting engine, I made fills a first-class model: queue position for limit orders, book-walking for market orders, and a latency parameter that delays every action by a configurable number of milliseconds. Strategies that survived that treatment behaved almost identically in paper trading. Strategies that didn't were quietly deleted.

Look-ahead bias hides in your data layer

Look-ahead bias is rarely a strategy bug — it's a data engineering bug. Corporate actions applied retroactively, candles rebuilt from revised ticks, indicators computed over a full series before the loop starts. If your data layer can hand your strategy a value it could not have known at that timestamp, it eventually will.

The fix is architectural, not disciplinary. My engine is event-driven: the strategy receives events one at a time and physically cannot index into the future. You should not have to trust yourself to avoid look-ahead. The system should make it impossible.

Costs are a strategy killer, not a footnote

Brokerage, exchange fees, taxes, and slippage routinely consume 30–60% of the gross edge of an intraday strategy in Indian markets. A backtest that treats costs as an afterthought is not an approximation — it is fiction. Model every cost per fill, per leg, per venue.

What an honest backtest looks like

  • Event-driven execution — no vectorized shortcuts on the critical path.
  • Fill simulation with latency, queue position, and market impact.
  • Point-in-time data, including delistings and corporate actions.
  • Full cost model, validated against real contract notes.
  • A paper-trading stage that runs the same code as live.

An honest backtest will reject most of your ideas. That's the point. The few that survive are the ones worth risking capital on.