← 1-Year PathQ3 · Algo

Week 35 — Backtesting & Market Making

How to test a strategy properly, and how market makers actually make money.

Week 35 of 52 · ~7 hours · 13 slides · exam + project

Proving It Works

Backtesting is where most strategies go to die — correctly.

What you will learn

  • Build a rigorous backtest
  • Understand market making
  • Avoid backtest pitfalls

The test loop

SignalEntryManageReviewA systematic, repeatable loop — no emotion, no guessing
The test loop

Measuring real risk

TimePortfolio value Drawdown peak → trough
Measuring real risk

What a backtest tests

A backtest replays your strategy against historical data and reports the result. But the raw result is almost always optimistic. A honest backtest must account for fees, slippage, and survivorship bias — otherwise you're testing a fantasy.

💡 The optimism gap

Your backtest shows 40% annual returns. But it ignored 0.1% per-trade fees, slippage on fills, and it only used stocks that still exist today (survivorship bias). With costs, the real result is often near zero — or negative. Costs are the truth serum of backtests.

Robustness checks

A good backtest is stress-tested: out-of-sample data (test on periods you didn't tune on), different regimes (bull/bear/choppy), and parameter sensitivity (does a tiny tweak destroy the edge?). A strategy that only works with one exact setting is curve-fit, not real.

How market makers work

Market makers quote both a bid and an ask and earn the spread. They profit from the flow of trading — buying at the bid, selling at the ask — not from predicting direction. Their edge is the spread, their risk is inventory (being stuck holding a falling asset) and adverse selection.

💡 The maker's real risk

A market maker earns $0.01 per share on millions of shares — but adverse selection is brutal: when a big informed trader hits their ask, the maker is left holding an asset about to fall. Makers survive by managing inventory and widening spreads when risk rises.

The takeaway

Backtesting separates fantasy from strategy; market making teaches you that edge often comes from structure (the spread, the flow) rather than prediction. The sophisticated path is to earn structural edge — not to out-predict everyone.

❓ Quick check

A backtest that ignores fees and slippage is:

A) Realistic
B) Overly optimistic
C) Too conservative
D) Perfect
(Knowledge check — full exam is next)

Key takeaways

  • Honest backtests include fees, slippage, and survivorship
  • Stress-test: out-of-sample, regimes, parameter sensitivity
  • Market makers earn structural edge (the spread), not predictions

📝 Weekly Exam — pass with 80% to unlock next week

10 questions. Review the Deep Dive and courses before attempting.

1. A backtest replays a strategy against:
Historical replay.
2. Survivorship bias is:
Winners only → inflated.
3. A backtest ignoring fees/slippage is:
Costs omitted.
4. Out-of-sample testing means:
Avoids curve-fitting.
5. A strategy that only works with one exact parameter is:
Overfit.
6. A market maker earns:
The spread.
7. A market maker's main risk is:
Holding inventory that moves against them.
8. Adverse selection hits makers when:
Informed flow picks them off.
9. Structural edge is:
Structural, not predictive.
10. The sophisticated path is to:
Structure beats prediction.
Your score: —

🛠 Weekly Project

Backtest one rule honestly (with costs).

1
Pick a simple rule and a month of daily prices.
2
Simulate the trades and compute gross return.
3
Subtract 0.1% fee + 0.1% slippage per trade.
4
Write one sentence on whether the edge survived costs, and what that taught you.
Open tool →
← Week 34  |  Week 36 →