Day 156 — Synthetic data whose right answer you already know

Saturday, 9 January 2027 · Week 23 of 52 · The research harness · Study day · 60 min

Testing an engine against real data can only tell you it produces a number; testing it against a case with a closed-form answer tells you the number is right.

What you should be able to do tonight

  • Construct at least two synthetic cases with analytically known strategy returns and assert the engine reproduces them.
  • Say what each case tests that the other does not.

Tasks 60 min

35 min Build three cases in tests/: a constant-drift series where a fully invested strategy’s return is exact, a deterministic sawtooth where a perfect mean-reversion rule’s gross return is exact, and a case with a known cost so the net return is exact. Assert each to tight tolerance.

25 min Make the cost case sharp: with a known turnover and a fixed cost per trade, the annual cost is arithmetic, so assert the engine’s reported cost against the hand computation. This catches double-counting of the spread, which is the most common cost bug and one that flatters the strategy.

Resources

Deliverable

Three synthetic test cases with analytic answers, all passing to a stated tolerance.

Checkpoint

Which of your synthetic tests would catch a spread charged twice, and how tight is the tolerance you set?

Prepare for tomorrow

Ten minutes tonight so Day 157, Sunday, 10 January 2027 starts clean. This is what the evening email sends you.

Generate 200 random position series with the same turnover as your pairs strategy but no relationship to returns.

Run them through the engine and save the Sharpe of each.

Do not look at the distribution yet.