Skip to content
Thursday, 19 November 2026 · LondonENع
Rayan Azhari.Sustainability · Energy · Carbon · Built Environment · Data Science
Category

Production Quant Trading

Purged Cross-Validation and Train/Serve Skew: Four Gates Before an ML Model Trades

When the strategy is a machine-learning model, standard validation lies to you: overlapping labels leak across a naive k-fold split and manufacture a phantom score. Here are the four mechanism-level gates I make any live ML model clear before it touches capital, and the war-story of a model that looked excellent until I purged and embargoed the folds and watched it collapse.

· 9 min

Cannot Trade a US ETF in the UK: Streaming Data, PRIIPs and the Substitute Pattern

Under PRIIPs, a UK or EU retail account can stream a US-listed ETF's market data yet be forbidden from ever holding it, because the fund publishes no Key Information Document. Here is the production pattern I use when my cleanest signal lives on an instrument I am not allowed to trade: compute the signal on the data-only line, trade a UCITS substitute, and match the substitute on currency, not just correlation. The broker catalogue, not the alpha, defines your tradable universe.

· 9 min

Live Trading Does Not Match the Backtest: The Code-Level Causes Nobody Names

When your live P&L drifts from the backtest you validated, the culprit is almost never psychology. It is code: the same metric computed two subtly different ways in research and in the live sizing path. Here is the parity oracle I now gate on, and the deeper rule behind it: live and research must call the same code, not two copies of it.

· 9 min

Fail Closed Data Validation: Why a Trading Bot Should Refuse to Boot on Bad Data

A data-quality gate that crash-loops on corrupt, stale or all-NaN data is not broken, it is working: the alternative is fail open, trading on garbage with silent defaults. Here is the war-story from both sides, the honest flip where an over-eager gate locked me out of a market, and the one portable rule: on bad data, refuse to trade and alert loudly, never proceed with a default that looks like data.

· 9 min

Bar Timestamp Convention: The Open vs Close Stamp That Leaks a Full Bar of Look-Ahead

A bar carries one timestamp, but that stamp is ambiguous: is a bar labelled 09:00 the open of the coming interval or the close of the last one? Vendors disagree, and reading the wrong edge is a clean one-bar look-ahead that sails through review. Here is the war-story, why the leak is invisible, and the ingest rule I now enforce on every feed.

· 9 min

Adjusted vs Unadjusted Close: The Dividend Double-Count That Fakes a Backtest Edge

Total-return and price-return series look identical on a chart and differ by percent-per-year underneath. Mix them, or fold dividends in twice, and a long-horizon backtest drifts a few percent above the honest one every year and compounds into a phantom edge. Here is the reconstruction check I now run: rebuild total return from price plus the dividend stream yourself and diff it against the vendor's adjusted series.

· 9 min

Survivorship Bias in a Backtest: The Delisted-Fraction Smell Test

Survivorship bias is the term every quant knows and almost nobody makes actionable. Here is the one-number diagnostic I run before I trust any cross-sectional backtest: count the dead names as a share of your universe over a decade. If it is near zero, your data quietly deleted the losers and every result is biased upward.

· 9 min

Capacity and Crowding: Why a Real Edge Still Decays at Size

Even a genuine edge dies if you deploy it too large. This is the field note on alpha-side risk: how your own market impact (capacity) and everyone else trading the same signal (crowding) shrink the size at which the edge is still yours, and the crossover test that tells you where your ceiling sits before the market finds it for you.

· 9 min

Essays in your inbox

New writing on Syria, sustainability and finance, a few times a month.

Unsubscribe anytime. Read by 4,200+ professionals.