Skip to content

Knowledge Centre

Field notes

A technical curriculum for engineers, analysts and students who want to research and run systematic strategies. The reading path runs from an idea and the research that tests it to a strategy in production. Figures built from data come with the code that reproduces them, and every note ends with its primary sources.

A map of the field notes as a night sky: the Introduction is the fixed star, each track is a constellation, and the lines follow the reading path. Use the arrow keys to move from star to star. The same notes are listed in full below.

The curriculum as a night sky: each note a star on its track’s orbit about the introduction, the reading path drawn as the lines. The same notes are listed by track below.
Start hereIntroduction to the seriesWho the notes are for, and where to start.

Foundations

Which ideas deserve to be traded, and how should they be tested?

  1. Market anomaliesMost published return anomalies shrink once they are known, and the reason an anomaly exists predicts how it will fail.About nine anomaly families, led by momentum, trend, value and carry, account for most of the credible evidence. Each has a candidate explanation (risk, behaviour or limits to arbitrage), and the explanation suggests how the effect will fail. In McLean and Pontiff’s study of 97 published predictors, returns fell by about a quarter out of sample and by more than half after publication, before costs. Testing many ideas manufactures impressive backtests; a trial ledger and the deflated Sharpe ratio, which discounts a result for the number of trials behind it, correct for it.Outcome Judge a claimed edge by its rationale and its out-of-sample record, and discount a backtest for the number of trials behind it.Introductory21 min read41 references
  2. Data for systematic tradingThe data errors that make a backtest look better than it is, and how to catch each one in code before a strategy reads it.Many errors in systematic research are data errors that look like results. On synthetic data where the true answer is known, we measure four of them: survivorship, adjusted prices read on the wrong date, futures contracts joined the wrong way, and fundamentals used before they were published. A survivors-only universe of identical stocks gains about five percentage points a year from selection alone. Each problem has a remedy that fits in a few lines of code, and the checks that enforce them are tested against planted faults.Outcome Build point-in-time, survivorship-free histories with the right adjustments and roll rules, and a tested check suite that stops bad data before a strategy reads it.Intermediate28 min read20 references
  3. Indicators and the 200-day moving averageOn a century of daily US data, the 200-day moving average reliably lowers risk, while its return advantage depends on the decade and on the execution.Indicators fall into five families, and six checks separate a sound test of one from a misleading one. We apply them to a single rule on US daily data since 1927: hold the market while it is above its 200-day moving average, otherwise hold T-bills. The rule’s lower risk survives every check. Its higher return belongs to the years before 1990, and disappears with one day of execution delay and a cost of 10 bp per switch.Outcome Backtest a signal without look-ahead, with realistic delays and costs, and report how the result moves with every choice.Intermediate19 min read12 references

Research infrastructure

What runs a backtest, and how do you keep thousands of them reproducible?

  1. QuantConnect and LEANOne open-source engine runs the same algorithm in backtest and live, and its defaults decide how far the two drift apart.QuantConnect is a hosted research and trading platform built on LEAN, an open-source engine released in 2015. One algorithm runs in backtest and live because the engine swaps the data and transaction handlers underneath it. The parity mostly holds. Where it fails, the cause is usually a default the user should override: the fill model, the data resolution, or the timing of orders placed after the close. Going live changes the handlers, the starting book and what a restart costs, and each can be prepared for in the backtest.Outcome Write a first LEAN algorithm, set its reality models explicitly, and know where backtest and live can diverge.Introductory17 min read38 references
  2. Running backtests at scaleA backtest can be trusted only if it can be reproduced and counted, and both have to be built into the pipeline before the first sweep runs.Run thousands of backtests and two things go wrong: results that cannot be reproduced, and winners chosen from searches nobody counted. We identify each run by a hash of its code, parameters, data and engine, run the jobs through a leased queue that tells transient failures from permanent ones, and write each attempt to a ledger. The deflated Sharpe ratio then judges the best result against the size of the search. On a real sweep of 156 variants of the 200-day rule, the best variant’s edge over a matched market exposure has a probabilistic Sharpe ratio of 99.8% judged alone and a deflated one of 93%, short of the 95% bar we set.Outcome Build a research queue with reproducible runs, experiment tracking and a trial ledger that feeds the deflated Sharpe ratio.Intermediate36 min read15 references

Portfolio construction and risk

How large should each position and each strategy be, and what limits the downside?

  1. Volatility targetingSizing positions by forecast risk to keep the risk carried roughly constant, and where the rule stops protecting.Volatility targeting sizes each position as target volatility divided by forecast volatility. The rule stabilises risk in each asset class studied, but raises the Sharpe ratio mainly where expected returns do not rise with volatility, as in equities and credit. Judged against a constant exposure with the same volatility, nearly a century of US data shows a modest gain on the market, too small to be statistically distinguished from zero, and a large, clear one on the momentum factor.Outcome Size positions by forecast risk, choose an estimator, and judge the result against a benchmark with the same volatility.Intermediate27 min read21 references
  2. Building strategies from componentsSelf-contained components with their own signal, sizing and state, tested alone and in the book, and why a component’s standalone Sharpe ratio says little about what it adds.We build strategies from components: small units with their own signal, sizing and state that emit target weights through one interface, while budgets, netting and book-wide limits live outside them. Components can be tested alone for invariants, look-ahead and restart behaviour; a restart test shows that a no-trade band makes a seemingly stateless rule hard to recover from a short history. On a century of public data, three textbook components show why a contribution must be measured alone, inside the book and by leaving it out at equal risk: the three answers disagree, and only together do they show what each component adds and what it costs.Outcome Design a strategy as independent components, each with its own signal, sizing and state, joined to the book through one interface.Intermediate20 min read8 references
  3. Combining strategies into one bookCorrelation depends on how often it is measured, and so does every decision about how to size, net and cap strategies in one book.Combining strategies depends on estimates of risk and correlation, and those estimates depend on how often they are measured. On a century of public factor data, the market and the size factor are negatively correlated day by day and positively month by month, which reverses the case for adding size to a market book, though the gain or loss is small. Every pair of streams shares its worst periods 2 to 11 times as often as its correlation implies. Simple risk-based rules matched estimated mean-variance weights out of sample with far steadier weights. A volatility target on the book raised the paper Sharpe ratio, mostly before 1963 and largely at the expense of leverage that a financing spread of 1% on the exposure above 1× would have eaten, and it delivered more risk than intended when measured monthly.Outcome Allocate across strategies by risk and correlation, net shared positions, and add a risk overlay for the whole book.Intermediate22 min read19 references

Execution

What does trading cost, and how do you measure and reduce it?

  1. TWAP, slicing and jitterA trade’s cost is measured against the price when it was decided; splitting an order keeps that cost down, and an irregular schedule makes it harder for others to trade ahead of it.The cost that matters is implementation shortfall: the gap between the price when the order was decided and the prices actually paid. Impact grows roughly with the square root of order size relative to daily volume, and the Almgren–Chriss trade-off between impact and timing risk sets how an order should be split. Jitter makes a schedule harder to anticipate, at a small and measurable cost. Execution quality becomes visible only across many orders, and at realistic timing risk a comparison of two algorithms needs well over a thousand of them.Outcome Schedule child orders against impact and timing risk, add jitter, and measure implementation shortfall over enough orders to mean something.Intermediate20 min read10 references

Production operations

Once real money is at stake, how do you know the system is doing what the research said it would?

  1. Going liveGoing live tests the machinery around a strategy, and most of what can go wrong there can be measured before money moves.We freeze each release under one fingerprint and rerun it over the recent past until its decisions match research exactly. Some live differences are designed in, and the gap between a backtest and its live twin splits into decisions, fills and costs. A power calculation shows that early live P&L cannot detect a realistic shortfall for months, so capital stages are gated on mechanics that can be checked each session. A journal of orders, state rebuilt from the broker, a kill switch that stays tripped and a one-step rollback let the system fail without doubling anything.Outcome Freeze a release, prove it reproduces research, start with a staged ramp gated on mechanics, and restart, halt or roll back without doubling an order.Intermediate19 min read10 references
  2. Monitoring a live bookEnd-of-day checks that show their evidence, and that say so when they could not look.Each evening we check that the broker holds what the strategy intended, that each instrument filled its intended change, that exposure is within limits, that prices are from today and that the day’s P&L is explained. Every check returns pass, fail or unavailable, and the report ranks unavailable above pass. Each result carries a witness, the dated evidence it read in this pass, and each check is trusted only after it has caught the fault it was written for.Outcome Build daily checks on holdings, exposures, fills and data, and prove that each check catches the failure it targets.Intermediate14 min read5 references
  3. Alerting that people act onAn alert rule is a classifier: score it on what it catches, what it misses, how late it speaks and how often it cries wolf.An alert asks someone to act, so each one should say what is wrong, what to do and when it clears. When incidents are rare, even a good detector’s alerts are mostly false; Bayes’ rule shows that the rate of false alarms on quiet checks decides how many can be believed. On a synthetic metric with known incidents, a run length and hysteresis raise the share of useful alerts from about a sixth to about two fifths while catching almost as many incidents, at a cost of twenty minutes to half an hour of delay. Alerts go out through a durable outbox with receipts and escalation, a heartbeat catches a monitor that has stopped, and each rule is kept or retired on its record.Outcome Design alerts with an owner and an action, measure how often they are right, and retire the ones nobody acts on.Intermediate15 min read10 references
  4. Live versus backtest reconciliationEvery gap between a live book and its backtest has a cause, and a daily comparison of holdings, decisions and returns names it.We rerun the frozen release from the live account’s starting state and compare, session by session, what the broker holds with what the backtest holds, and the live decisions with what the release makes of the live inputs. The return gap is split among its causes by switching them on one at a time and by averaging over every order of switching them on. A band that widens with the square root of time catches excess noise, and a t-test on the daily difference catches drift the band cannot see.Outcome Reconcile positions and returns against broker records and a same-period simulation, and attribute each gap to data, timing, fills or code.Intermediate18 min read7 references

Code is Python with pandas and NumPy. Listings that produced numbers ran on the data or simulator named beside them; the QuantConnect and LEAN listings run on that platform. Notation is defined in the introduction.