Skip to main content
Trading

Building a Backtesting Engine That Doesn't Lie to You

March 28, 202612 min read
PythonBacktestingTradingQuantitativeRisk Management
Share:

Every quantitative trader has had this experience: backtest shows 200% annual returns. Live trading shows -15%.

The problem is almost never the strategy. It's the backtest. Most backtesting engines lie through optimistic assumptions.

The 5 Lies Most Backtests Tell

Lie 1: Perfect Fills

Most engines assume your order fills at the exact price you see. In reality:

  • Market orders fill at the ask (buying) or bid (selling), not the mid-price
  • Large orders move the market (slippage)
  • During volatility, fills can be 5-10 ticks worse than expected

My engine models this: \

Related reading

All posts →
Jason Teixeira
Written by
Jason Teixeira
Founder, Sage Ideas Studio
More about Jason →

Want to see this in action?

Check out the projects and case studies behind these articles.

livebuild 29be8ec2026-06-11 06:38Z
// solo studio// no analytics resold// every commit human-reviewed