The running strategy

One trading system, built over the whole year. Every day that moves it forward, in order.

The days that teach and the days that build are the same days. From the first week you are assembling one system — data, signals, portfolio construction, costs, execution, monitoring — and by the capstone it is running on a schedule against a paper account with a track record you did not tamper with. This page is that thread pulled out of the calendar.

83 days move the system forward.

Markets

Day 20 · Wed 26 Aug · The store, part one: schema and ingestion

The data store begins. qlib/store.py defines the schema and qlib/ingest.py fills it; every table carries both the date a fact refers to and the date you learned it, which is the constraint that makes point-in-time queries possible later rather than retrofitted.

Day 22 · Fri 28 Aug · The store, part two: adjustment as a view, not a column

The store can now return both a raw price series and a total-return series from the same rows, with adjustment computed at read time. That choice is what will let a backtest run in March against the same file you ingested in September without the history having quietly moved.

Day 23 · Sat 29 Aug · The store, part three: the test that makes as-of true

The as-of semantics are now enforced by two tests rather than by intention. This is the first instance of the pattern that week 23 generalises: leakage is prevented by construction and asserted by a test, never by remembering to be careful.

Day 28 · Thu 3 Sep · Milestone: the market map and a store that does not lie

Milestone 1 closes phase 1 with a working point-in-time daily store and a written account of what it cannot do. Every backtest for the rest of the year reads from qlib/store.py, and the limitations section is the list you check whenever a result looks better than it should.

Returns and noise

Day 45 · Sun 20 Sep · Every performance number gets an interval from now on

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.

Day 53 · Mon 28 Sep · Implement the correction, and make the count automatic

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.

Day 60 · Mon 5 Oct · A simulator whose output passes your own stylized-facts test

qlib/simulate.py gives the project a null that is not a straw man. Any strategy result from here can be run against synthetic data with the same tails and clustering as the real thing, which is what makes a false-positive rate measurable rather than assumed.

Day 61 · Tue 6 Oct · The noise floor: one number you will be held to

qlib/noise.py fixes the evidence threshold for the whole year. Every later milestone reports its results against this number, which was computed before any of those results existed, and that ordering is what makes it a threshold rather than a rationalisation.

Day 63 · Thu 8 Oct · Milestone: the stylized facts and the noise floor

Milestone 2 sets the evidence bar for everything that follows. qlib/stats.py, qlib/simulate.py and qlib/noise.py are now the three modules that every later strategy result passes through before it is allowed to be called a result.

Time series

Day 69 · Wed 14 Oct · The first strategy meets the noise floor

The first strategy in the book: a 12-month time-series momentum rule, evaluated against the noise floor from milestone 2 rather than against zero. The evaluation path it runs through is the one every later signal uses, so getting it right once is worth the hour.

Day 81 · Mon 26 Oct · The pair selection rule, written down before the results

qlib/signals/pairs.py holds the pair selection rule, fixed in code before any trading result exists, with its screen count logged automatically. The hurdle that count implies is on the first page of the milestone rather than in a footnote.

Day 82 · Tue 27 Oct · The half-life, and thresholds derived from it

The pairs rule takes its holding period and its thresholds from the fitted mean-reversion dynamics, and the parameter surface around that point is reported rather than hidden. Every point on the surface is a logged trial, which keeps the trial count honest.

Day 83 · Wed 28 Oct · The pairs backtest, with costs, in sample

The pairs strategy runs end to end with costs and produces a net Sharpe alongside a break-even cost curve. That curve becomes the standard chart for every strategy in the alpha book, because it says more than the headline number does.

Day 90 · Wed 4 Nov · Volatility targeting, and what it does and does not improve

The trend follower now sizes on a volatility forecast from qlib/vol.py rather than on constant notional, and the improvement is decomposed into the mechanical part and the forecast-quality part rather than claimed as a whole.

Day 93 · Sat 7 Nov · A hedge ratio that is allowed to move

The pairs strategy gains a dynamic hedge ratio estimated by maximum likelihood rather than a window length chosen by hand. The static version stays in the code as the comparison the milestone reports against.

Day 94 · Sun 8 Nov · Does the moving hedge ratio actually help, or just fit better

The dynamic and static hedge ratio versions of the pairs strategy are compared out of sample at matched turnover, so any improvement is attributable to the estimator rather than to trading more.

Day 96 · Tue 10 Nov · The out-of-sample run, once, on a period you never looked at

The pairs strategy is frozen in a committed configuration file and run once out of sample, with its result placed against the distribution the same procedure produces on synthetic data containing no relationships at all.

Day 98 · Thu 12 Nov · Milestone: a pairs strategy, and what it survived

Milestone 3 closes phase 3 with a complete strategy: selection rule, derived thresholds, dynamic hedging, one out-of-sample run, and a false positive rate measured on synthetic data. Whatever its Sharpe, the pipeline it exercised is the one phase 5 rebuilds properly.

Portfolios and risk

Day 103 · Tue 17 Nov · The three benchmarks that beat you, and when they do not

qlib/portfolio.py starts with the three benchmark constructions. Every portfolio result for the rest of the year is reported next to them, which is the rule milestone 4 is graded on.

Day 110 · Tue 24 Nov · One covariance interface, four estimators behind it

qlib/risk.py gives the project one covariance interface with four estimators behind it, tested for positive definiteness on every window. The portfolio construction code no longer knows or cares which estimator is in use.

Day 117 · Tue 1 Dec · Neutralising a portfolio, and what it costs you

qlib/portfolio.py can now neutralise a weight vector against an arbitrary exposure set, with a test asserting the residual exposures are zero. The pairs strategy runs neutralised from here, and the unneutralised version stays as the comparison.

Day 120 · Fri 4 Dec · Targeting a volatility at the portfolio level

The book is sized to a volatility target computed from the risk model’s forecast rather than from trailing realised volatility, with an explicit leverage cap and the added turnover reported.

Day 123 · Mon 7 Dec · Backtesting a risk model: coverage and independence

qlib/risk.py can now test a risk model rather than only produce one, with coverage and independence tests that any later model has to pass before its numbers are used for sizing.

Day 130 · Mon 14 Dec · Risk of ruin, and the constraint that is not statistical

The book’s sizing now respects a hard barrier derived from maintenance margin rather than a soft statistical threshold, and qlib/portfolio.py computes the ruin probability from leverage and margin directly.

Day 131 · Tue 15 Dec · Sizing the actual book, with every number defended

The full sizing pipeline runs end to end: covariance, neutralisation, volatility target, Kelly fraction, leverage cap. Phase 6 changes only what feeds it, and phase 10 runs this exact code on a schedule.

Day 133 · Thu 17 Dec · Milestone: a factor risk model built by hand

Milestone 4 closes the portfolio phase. qlib/risk.py and qlib/portfolio.py now hold the covariance estimators, the neutralisation, the volatility target and the sizing rule, and every signal built in phase 6 flows through them unchanged.

The research harness

Day 136 · Sun 20 Dec · A universe that only contains what existed at the time

The store now returns a universe as of a date, built only from information available then. Every signal from here selects from that universe, so the survivorship problem is fixed in one place rather than remembered in twelve.

Day 139 · Wed 23 Dec · The rebuild, and the test that guards it

The store’s read interface now requires an as-of date on every path and enforces per-source availability lags, with three tests that fail if a future value becomes visible. This is the foundation the event-driven engine is built on next week.

Day 142 · Sat 26 Dec · The event loop, and the order things happen in

qlib/backtest/engine.py is the event loop the rest of the year runs on. The strategy sees an as-of view rather than the store, so look-ahead is prevented by the interface rather than by care.

Day 143 · Sun 27 Dec · The fill model is where optimism hides

The engine has a pluggable fill model with three conventions and partial fills, so the price a backtest assumes is a stated configuration rather than a hidden default.

Day 144 · Mon 28 Dec · Orders have a lifecycle, and positions are derived

Fills are the primary record and everything else is derived from them, written to fills.parquet. The accounting identity is asserted at every session, which is the invariant phase 10 reconciles the live account against.

Day 145 · Tue 29 Dec · One result object, and everything downstream reads it

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.

Day 153 · Wed 6 Jan · The cost model, with the components separated

Costs are recorded per fill and per component in fills.parquet, so the strategy’s cost can be attributed rather than only totalled. Phase 9 replaces the impact component with a fitted one and nothing else changes.

Day 157 · Sun 10 Jan · The null strategy test, and what your engine says about nothing

The null-strategy distribution is now a characterised property of the engine and a standing test. Phase 6 evaluates every signal against this distribution rather than against zero.

Day 159 · Tue 12 Jan · One command, same number, six months later

Every result is reproducible from a configuration file and a commit hash with one command, and each result records the code version and data cutoff that produced it. This is the property that makes the platform worth showing to someone.

Day 161 · Thu 14 Jan · Milestone: the research platform

Milestone 5 closes the harness. The event loop, the fill model, the cost breakdown, the point-in-time store and the test suite are the platform every signal in phase 6 runs through, unchanged.

Alpha

Day 162 · Fri 15 Jan · A signal is a forecast with a scale you have to choose

qlib/signals/base.py defines the signal interface for the whole alpha book: as-of date in, one score per security out, units declared. The two existing strategies become signals, which separates the forecast from the sizing for the first time.

Day 165 · Mon 18 Jan · Neutralise the signal, not just the portfolio

Signals are neutralised at the signal level against a standard exposure set declared once for the whole book, with the variance removed reported per signal so the cost of neutralising is visible.

Day 167 · Wed 20 Jan · The first three signals, built through the interface

Three signals are in the book, each implemented through the same interface and run through the same pipeline. Adding the fourth is now a file rather than a project, which is the property the alpha book needs.

Day 169 · Fri 22 Jan · The information coefficient is a Spearman correlation

qlib/signals/evaluate.py computes the information coefficient with a dependence-aware standard error and a null distribution from random signals, so every signal in the book is reported against a measured null rather than against zero.

Day 174 · Wed 27 Jan · One page per signal, generated rather than written

qlib/signals/report.py generates the standard one-page signal summary from the result object. Milestone 6 becomes an assembly of generated pages rather than a document that can disagree with the code.

Day 176 · Fri 29 Jan · Value, replicated with the reporting lag respected

Value joins the book as the first fundamental signal, built on the point-in-time filing schema, with the cost of getting the lag wrong measured rather than assumed.

Day 177 · Sat 30 Jan · Momentum, and the crashes that pay for its Sharpe

Momentum is in the book with its conditional crash behaviour measured and its rolling beta documented, so the sizing decision in week 29 has the tail behaviour in front of it rather than only the volatility.

Day 178 · Sun 31 Jan · Quality, and the definition problem underneath it

Six quality specifications are evaluated identically and all six are logged, so the best one is reported with the correction its selection implies rather than as a discovery.

Day 179 · Mon 1 Feb · Low volatility wins, and the explanation is a constraint

Low volatility and betting against beta are both in the book, with the leverage required by the beta-neutral construction reported explicitly, since that leverage is both the mechanism of the return and the constraint on running it.

Day 180 · Tue 2 Feb · Short-term reversal is real, and mostly a liquidity payment

Short-term reversal and size join the book. Reversal is the book’s clearest case of a signal that is real gross and dead net, and it stays in the book for exactly that reason.

Day 184 · Sat 6 Feb · Time-series momentum, and where its diversification comes from

The trend follower becomes a portfolio of trend rules across instruments and lookbacks, combined rather than selected, with the correlation structure that justifies the combination measured rather than assumed.

Day 185 · Sun 7 Feb · Carry is one definition applied to four asset classes

A carry signal built from term structure joins the book, evaluated on the same footing as everything else, with its correlation to trend measured so the combination in week 29 has a real input.

Day 190 · Fri 12 Feb · Fundamentals at scale, from EDGAR rather than a vendor

Fundamental data now comes from EDGAR directly into the store with filing dates attached, so every fundamental signal in the book is point-in-time by construction rather than by a lag applied afterwards.

Day 201 · Tue 23 Feb · The combined book, with every constraint applied

The combined alpha book runs through the whole pipeline end to end and produces one result object, with each signal’s marginal contribution computed by leave-one-out rather than by standalone performance.

Day 203 · Thu 25 Feb · Milestone: the alpha book

Milestone 6 closes the alpha phase. The book holds eight characterised signals, a measured correlation structure, a defended combination and a corrected verdict, and phase 7 asks whether a nonlinear model can beat it.

Machine learning

Day 206 · Sun 28 Feb · Purging and embargoing, and why they are two fixes

qlib/ml/cv.py provides a purged and embargoed splitter with the scikit-learn interface, so every model search in the phase uses it by default and the noise experiment from day 205 is a standing test that it works.

Day 209 · Wed 3 Mar · The dataset assembly, and the test that guards it

qlib/ml/dataset.py assembles the feature matrix through the store’s as-of interface with a test that no feature value postdates its row. The poisoned-future test now covers the model path as well as the engine.

Day 212 · Sat 6 Mar · The triple barrier labels what a trade would have done

qlib/ml/labels.py implements volatility-scaled triple-barrier labelling with the outcome distribution reported, so the label reflects what a position with a stop and a target would have experienced.

Day 216 · Wed 10 Mar · Cross-sectional labels, and the demeaning that decides the bet

The modelling protocol is frozen in a committed configuration file before any model is fitted: label, horizon, weights, validation scheme and metric. Week 34’s audit compares models under it without any of them having chosen it.

Day 218 · Fri 12 Mar · The linear baseline, taken as seriously as the rival

The linear baseline is fitted and tuned under the frozen protocol with nested penalty selection, and its interval is the bar every later model in the phase is measured against.

Day 230 · Wed 24 Mar · An external scoreboard where you cannot fool yourself

A model is submitted to Numerai, which gives the year an external, live-scored track record on data where no look-ahead is available to you, alongside the internal results you produced and evaluated yourself.

Day 233 · Sat 27 Mar · The audit, run once

The audit runs once on the frozen protocol and produces the phase’s headline comparison, with every pairwise difference tested against the seed spread rather than read off a leaderboard.

Day 238 · Thu 1 Apr · Milestone: machine learning against the linear baseline

Milestone 7 closes the machine learning phase. The ML layer either joins the book with a stated marginal contribution or does not join it, and either outcome is recorded with the interval that produced the decision.

Derivatives

Day 251 · Wed 14 Apr · The pricer, tested against two independent implementations

qlib/derivatives/black_scholes.py is the pricing layer for the rest of the phase, tested against an independent implementation and with implied volatility inversion that fails loudly rather than silently.

Day 278 · Tue 11 May · The variance premium as a signal, evaluated like any other

The variance risk premium signal joins the book, evaluated through the same pipeline as everything else, with an explicit note that its Sharpe ratio is not comparable to the equity signals’ because of the payoff asymmetry.

Day 280 · Thu 13 May · Milestone: an option pricer and a delta-hedging study

Milestone 8 closes the derivatives phase. qlib/derivatives holds a tested pricer, greeks, a hedging simulator and a surface fitter, and the variance risk premium signal is in the book with its asymmetry documented.

Microstructure

Day 292 · Tue 25 May · The square-root law, tested on your own data

The impact exponent and coefficient in qlib/costs.py are replaced by values fitted to real data with a stated uncertainty, which retires the largest assumption in every cost and capacity number reported since week 22.

Day 296 · Sat 29 May · The efficient frontier of execution, and where to sit on it

qlib/exec/schedule.py generates an execution trajectory from an order, a horizon and a stated risk aversion, using the fitted impact model rather than the linear assumption in the original paper.

Day 298 · Mon 31 May · Implementation shortfall counts the trade you missed

qlib/exec/shortfall.py measures implementation shortfall with opportunity cost included and its components reconciling to the total, which becomes the standard execution metric for the paper account in phase 10.

Day 299 · Tue 1 Jun · Measuring your own slippage, against your own decisions

The engine records decision, submission and fill timestamps with the prevailing mid at each, so implementation shortfall is measurable on the paper account from today rather than reconstructed later.

Day 302 · Fri 4 Jun · Capacity, recomputed with a fitted model

Every capacity figure in the alpha book is recomputed from the fitted impact model, and the combined book’s capacity accounts for signals competing for the same liquidity rather than being the sum of the parts.

Day 303 · Sat 5 Jun · Which strategy dies first as the money grows

The book is re-optimised at ten and a hundred times current size with size-dependent costs, showing how the composition changes as capacity binds rather than only how performance falls.

Day 308 · Thu 10 Jun · Milestone: execution, impact and honest capacity

Milestone 9 closes the microstructure phase. The cost model’s impact term is now fitted rather than assumed, every capacity figure has been revised, and the engine records what it needs to measure the live account’s shortfall in phase 10.

Production

Day 323 · Fri 25 Jun · The daily run, as a sequence of steps that can each fail

qlib/run/daily.py is the production entry point: seven ordered steps, each with an explicit success condition, and three checks for the failures that do not raise exceptions.

Day 324 · Sat 26 Jun · Logging for the questions you will ask in March

The production run emits structured JSON logs with run identifiers, per-step timings and the numbers behind each decision, so any day’s positions can be reconstructed from the log without rerunning the pipeline.

Day 325 · Sun 27 Jun · Monitoring the four things that actually break

Four monitors with thresholds calibrated against historical data run alongside the daily pipeline, each reporting a number rather than a boolean so that near-misses are visible before they become failures.

Day 326 · Mon 28 Jun · Alerting, and the runbook written before you need it

Alerts are routed by severity and every one has a runbook entry with ranked causes, diagnostic commands and a safe action, written before the first real incident rather than after it.

Day 327 · Tue 29 Jun · Reconciliation, and explaining every difference

Daily reconciliation compares intended against actual positions and cash with every difference attributed to a named cause, and an unexplained residual raises an alert rather than being absorbed.

Day 328 · Wed 30 Jun · The first unattended run, and what it got wrong

The pipeline runs unattended on a schedule, and the first failure is diagnosed from logs alone and fixed, with the failure category recorded in the runbook.

Day 329 · Thu 1 Jul · Milestone: the system in production

Milestone 10 closes the production phase. The book runs on a schedule against a paper account with monitoring, reconciliation and a runbook, and the track record it produces from here is the one the capstone reports without adjustment.

The interview

Day 352 · Sat 24 Jul · Three write-ups a stranger can read in ten minutes

The three write-ups are the form in which the year’s work actually gets read: result first, one figure, interval, specification count, and the most serious limitation, each in two pages.

Day 357 · Thu 29 Jul · Milestone: the interview dossier

Milestone 11 assembles the year’s work into the form a hiring process consumes: three two-page write-ups drawn from the milestones, a CV that describes the genetics work in the language of the job, and a firm list with outreach already sent.

Capstone

Day 358 · Fri 30 Jul · The track record, reported without adjustment

The live paper track record is reported with every period included and reconciled against the broker’s own statements, with the Sharpe standard error at this sample length stated on the same page as the estimate.

Day 359 · Sat 31 Jul · Where the live period disagreed with the backtest

The live-against-backtest difference is decomposed into execution, universe and signal components that sum to the total, which is the first empirical test of the ranked list of lies from milestone 5.

Day 360 · Sun 1 Aug · The research dossier, assembled from eleven documents

The research dossier pulls the year into one document with every claim traced to a milestone and a configuration, verified by reproducing three claims at random from a clean checkout.

Day 361 · Mon 2 Aug · What you would actually run, and at what size

The dossier gains a recommendation section: which components to run, at what capital and Kelly fraction, with the expected interval and accepted drawdown, and an explicit list of what is excluded and why.

Day 365 · Fri 6 Aug · Capstone

The system that started as an empty DuckDB file on day 20 now ingests, forecasts, sizes, executes, reconciles and reports on a schedule, with a track record it did not tamper with and a written account of everything it still gets wrong.