Day 53 — Implement the correction, and make the count automatic

Monday, 28 September 2026 · Week 8 of 52 · Returns and noise · Study day · 55 min

A correction you have to remember to apply is a correction you will not apply in March, so today it goes into the code that reports every Sharpe you will ever compute.

What you should be able to do tonight

  • Compute a deflated Sharpe ratio from a return series, a trial count and the cross-trial Sharpe variance.
  • Have your own tooling count the trials rather than trusting you to remember them.

Tasks 55 min

30 min Add deflated_sharpe() to qlib/stats.py, taking the observed Sharpe, the number of trials, the variance of Sharpes across trials, and the sample skewness and kurtosis. Test it against your day 51 simulation: feed it the null set and confirm the deflated value is not significant.

25 min Build the trial counter: a small append-only log, research_log.jsonl in the work repo, where every backtest run writes one line with the strategy name, parameters, date and realised Sharpe. Wire it into the stats module so that running an evaluation records itself. In eleven months this file is the evidence behind the number on the front page of milestone 6.

The running strategy

The research log begins. Every strategy evaluation from today writes a line to research_log.jsonl, so the number of trials behind any later result is a fact you can count rather than a number you have to recall.

Resources

Deliverable

qlib/stats.py with a tested deflated Sharpe, and research_log.jsonl accumulating one line per evaluation automatically.

Checkpoint

Where does the number of trials in your deflated Sharpe come from, and what happens to it when you rerun a grid search twice?

Prepare for tomorrow

Ten minutes tonight so Day 54, Tuesday, 29 September 2026 starts clean. This is what the evening email sends you.

Download the probability of backtest overfitting paper from eScholarship and read the abstract.

Write down what you think the difference is between it and the deflated Sharpe. One line.

Note how many parameter combinations your most recent grid search covered.