Day 145 — One result object, and everything downstream reads it

Tuesday, 29 December 2026 · Week 21 of 52 · The research harness · Study day · 60 min

Six strategies compared in phase 6 means six result objects that have to be identical in shape, and defining that shape now is cheaper than converting later.

What you should be able to do tonight

  • Define a result object carrying returns, positions, fills, costs, metadata and the trial record, and serialise it.
  • Produce a tearsheet from the result object alone, with no access to the engine.

Tasks 60 min

30 min Define the result in qlib/backtest/result.py: daily returns, positions, fills, a cost breakdown by component, the configuration that produced it, the code version, and the research log entry id. Serialise it to disk so a result can be reloaded a month later without rerunning.

30 min Build the tearsheet from it: equity curve, drawdown, rolling Sharpe with the interval from qlib/stats.py, turnover, exposure, and the cost breakdown. Compare your output against what pyfolio-reloaded produces on the same returns to check you have not missed a standard panel.

The running strategy

Every backtest now returns one serialisable result object carrying its own configuration and code version, and the tearsheet is built from that object alone. Reproducing a figure from March in July becomes a file read rather than a rerun.

Resources

Deliverable

qlib/backtest/result.py with a serialisable result, and a tearsheet generated from a reloaded result file.

Checkpoint

What does your result object carry that lets you reproduce a number six months later without rerunning anything?

Prepare for tomorrow

Ten minutes tonight so Day 146, Wednesday, 30 December 2026 starts clean. This is what the evening email sends you.

Clone zipline-reloaded and find its data ingestion and its main simulation loop. Do not run it.

Note the two design decisions it makes that yours does not.

Fifteen minutes of reading, no more.