Day 45 — Every performance number gets an interval from now on

Sunday, 20 September 2026 · Week 7 of 52 · Returns and noise · Study day · 55 min

A point estimate with no interval is what let the last twenty years of published backtests happen, and you are about to make it impossible for yourself to report one.

What you should be able to do tonight

  • Return a Sharpe ratio with its standard error and confidence interval from one function call.
  • Show your interval is correctly calibrated by simulation, not by assertion.

Tasks 55 min

30 min Extend qlib/stats.py: have sharpe() return the estimate, its standard error from yesterday’s formula, the sample size, and a 95 percent interval. Make the interval the default thing that gets printed, so reporting a bare number takes deliberate effort.

25 min Write tests/test_stats.py with a coverage test: simulate 2,000 series at a known true Sharpe, compute the interval for each, and assert the empirical coverage is within sampling error of 95 percent. This is the test that catches the annualisation factor being applied to the standard error in the wrong place, which is the standard bug here.

The running strategy

The performance layer now reports intervals by default and has a coverage test behind them. From here, any strategy result in this course that appears without an interval is a bug rather than a style choice.

Resources

Deliverable

qlib/stats.py returning Sharpe with an interval, and a passing coverage test in tests/test_stats.py.

Checkpoint

Your coverage test reports 88 percent instead of 95. Name the two most likely causes and how you would tell them apart.

Prepare for tomorrow

Ten minutes tonight so Day 46, Monday, 21 September 2026 starts clean. This is what the evening email sends you.

Compute the lag-1 through lag-5 autocorrelation of monthly returns for a trend-following series or any smoothed series you can build.

Compare it against the same autocorrelations for SPY monthly returns.

Write down which is larger, and by how much.