Skip to content
Coming next5 planned lessons

Module 05

Backtesting Honestly

Building a simple backtester, then making it honest — realistic fills and costs, no look-ahead, and metrics that describe risk as well as return.

What you will be able to do

  • Build a vectorised and an event-driven backtest of the same rules, and reconcile them.
  • Model commissions, spread and slippage.
  • Remove look-ahead bias with correct signal timing.
  • Report expectancy, drawdown, Sharpe ratio and exposure from a trade list and an equity curve.

Planned lessons

  1. 1

    A vectorised backtest in pandas

    Positions, returns and an equity curve computed from a signal column in a few lines.

    Coming next

  2. 2

    An event-driven backtest

    Processing bars one at a time, the way a live system sees them.

    Coming next

  3. 3

    Fills, costs and slippage

    Modelling the gap between the price that triggered a signal and the price you actually get.

    Coming next

  4. 4

    Timing and look-ahead bias

    Signal on bar t, fill on bar t + 1 — and the other timing rules that keep a test honest.

    Coming next

  5. 5

    Reading a backtest report

    Expectancy, drawdown, Sharpe ratio, exposure and trade count, read together rather than one at a time.

    Coming next