Skip to content
Friday, 10 July 2026 · LondonENع
Rayan Azhari.Sustainability · Energy · Carbon · Built EnvironmentOccasional detours into philosophy, religion or programming, wherever curiosity leads

Suspicion Over Celebration: Inside "Building a Production Quant Trading System"

An overview and review of Dr. Rayan Azhari's book, "Building a Production Quant Trading System." Explore why this practitioner's guide to the unglamorous 90% of systematic trading is essential reading, what to expect, and what not to expect.

Rayan AzhariChartered Environmentalist, MISEP
Building a Production Quant Trading System

The unglamorous 90% that decides whether a trading idea survives live markets

Most writing about quantitative trading obsesses over finding edges. It is a world of glittering Sharpe ratios, hyper-optimised machine learning models, and smooth equity curves. But if you have ever tried to take a strategy from a Jupyter notebook and run it with live capital, you quickly discover that finding the edge is only the first 10% of the problem.

The remaining 90% is unglamorous, frustrating, and rarely written about: proving the backtest is real, wiring it to a broker without lying to yourself, sizing it so a bad month doesn't wipe you out, and running it as a containerised process that survives API outages, data corruption, and your own future coding mistakes.

In Building a Production Quant Trading System: A practitioner's guide to the unglamorous 90%, Dr. Rayan Azhari addresses this missing middle. Built around a single, real-world case study (a multi-strategy, broker-connected systematic book called Titan), the book is a raw, battle-scarred guide to building a trading infrastructure that survives contact with live markets.

This article explores why you should read the book, what you should expect to find in its pages, and crucially, what you should not expect.


Why You Should Read It

If you are a software engineer, a quant-curious developer, or an individual trader who can read Python and knows what a Sharpe ratio is, this book is written specifically for you. Here is why it belongs on your reading list:

1. It adopts a philosophy of "suspicion over celebration"

The core thesis of the book is that every number you produce is biased toward optimism until proven otherwise. In systematic trading, errors are not symmetric; they do not average out to zero. Because optimistic errors are the ones that make a strategy look good, they are the ones that survive your attention and get funded.

A backtest that looks too good is not a cause for celebration; it is a crime scene that needs to be audited. The book teaches you how to maintain this level of healthy scepticism at every layer of your stack:

"When a result looks too good, the correct first reaction is not excitement; it's 'where's the leak?' ... Every chapter is, in some sense, a different way of not fooling yourself."

2. It is built on "war stories" and battle scars

This is not an academic textbook full of clean equations and hypothetical models. Dr. Azhari shares actual, painful mistakes shipped in the Titan stack, including:

  • A look-ahead bug that turned a flat trend-following strategy into a +4.0 Sharpe phantom.
  • A currency assumption that silently mis-sized a live position by a third.
  • A data-quality gate that crash-looped and locked up execution.
  • A defensive switch that stayed disabled throughout a major market crisis because it compared a challenger asset against a frozen snapshot of the incumbent rather than its live value.

You will learn far more from why each guardrail was built than from any clean, abstract architecture diagram.

3. It bridges the gap between research and operations

Most quant books treat deployment as an afterthought. They assume that if you have a mathematical strategy, it magically translates into money. Dr. Azhari treats deployment and operations as first-class engineering disciplines, explaining how a single rejected bracket order, an unrealistic commission cost model, or a silent database overwrite can destroy a profitable strategy.

4. It comes with a complete, open-source codebase

Rather than just discussing abstract concepts, the book is designed to be read alongside a fully functional, open-source companion codebase. The titan/ package and educational scripts are licensed under the Apache-2.0 licence and hosted on GitHub. Readers can clone the repository, run the quickstart, download sample data, and inspect the exact validation pipeline and risk engine described in the text. It serves as a production-grade blueprint that you can run, modify, and build upon.


What to Expect

The book is structured as a chronological build log following the continuous lifecycle of a strategy: Research → Validate → Deploy → Operate → Learn. It now runs to 45 chapters across seven parts (plus a set of appendices and a runnable walkthrough), roughly 90,000 words, and every chapter closes with exercises whose answers are worked in full.

flowchart LR
    R[Research<br/>find a candidate edge] --> V[Validate<br/>prove it's real]
    V --> D[Deploy<br/>wire it to a broker]
    D --> O[Operate<br/>run it unattended]
    O --> L[Learn<br/>capture what broke]
    L --> R
    V -. "reject / retire" .-> R
    style R fill:#1e293b,stroke:#3b82f6,color:#fff
    style V fill:#1e293b,stroke:#10b981,color:#fff
    style D fill:#1e293b,stroke:#f59e0b,color:#fff
    style O fill:#1e293b,stroke:#8b5cf6,color:#fff
    style L fill:#1e293b,stroke:#ec4899,color:#fff

Here is a breakdown of what you can expect from each part of the book:

PartCore FocusWhat You Will Learn
I. Foundations & ArchitectureSystem StructureWhy systems fail before a single trade, then laying out a modular codebase (built on NautilusTrader) that prevents whole classes of bugs by design.
II. Research & ValidationTrustworthy BacktestingExposing the statistical lies backtests tell, deflating Sharpe ratios for multiple testing, walk-forward and tail-risk/ruin analysis, capacity and crowding, and turning go/no-go into a decision function (the Sanctuary matrix) plus a running failure-mode catalogue.
III. Data EngineeringSourcing & StorageBuilding robust pipelines, storing time-series data, handling sessions, calendars and time correctly, and gating runtime execution against corrupted or stale data feeds.
IV. From Research to ProductionLive-Equals-Research ParityA typed strategy-class contract, ensuring live execution computes the exact same metrics as the backtest, order lifecycle and idempotency, a full execution-and-costs layer (slippage, fills, a constructed cost model), and what changes when the strategy is a machine-learning model.
V. Portfolio & RiskSurvival MathematicsPer-strategy equity and FX, position sizing via fractional Kelly, combining forecasts, the portfolio risk manager, a correlation dial for the allocator, factor and beta exposure, and a multi-layered safety net to keep a bad day from being fatal.
VI. Deployment & OperationsInfrastructure & Live OpsContainerising the stack with Docker, observability and live TCA, alerting and a dead-man's switch, runbooks, running an incident and its postmortem, state durability and disaster recovery, reconciling against the broker, and a capstone that threads one strategy end to end through every pipeline stage.
VII. ReflectionsRegrets & Open GapsAn honest look at the limitations of the Titan system, solo-operator versus team trade-offs, open engineering challenges, and a curated reading list.

Successive revisions have widened the operational half of the book considerably. Part IV now carries a dedicated execution-and-costs chapter, an order-lifecycle-and-idempotency chapter, and a full treatment of what changes when the strategy is a machine-learning model. Part VI has become the densest part of the book: observability, live transaction-cost analysis, alerting and a dead-man's switch, running an incident and writing the postmortem, state durability and disaster recovery, and reconciliation against the broker. Anchoring it all is a capstone, One strategy, end to end, that walks a single illustrative sleeve through every pipeline stage so the separate disciplines read as one chain rather than seven parts, and Appendix D is a hands-on session with the companion framework: clone it, run the validation pipeline on sample data, then break the discipline on purpose and watch the gate catch you.

The Five Lies of Backtesting

One of the most valuable chapters in the book is A backtest you can trust. It exposes the five ways a backtest quietly flatters a strategy and details the specific engineering fixes built into the Titan framework:

  1. Units (The Annualisation Lie): Sharpe ratios scale with the square root of time. If you calculate hourly returns but annualise them as daily, your Sharpe is inflated by 4.9×. The fix is to make periods_per_year a required, explicit argument in every metrics helper.
  2. Survivor Math: Filtering out flat bars (zero returns) because they look like "clutter" destroys the strategy's selectivity profile, inflating the Sharpe. The fix is to never filter zeros before annualising a return series.
  3. Peeking (Look-Ahead Bias): Using information from the close of bar t to trade the return of bar t. The fix is a strict shift discipline: returns * position.shift(1).
  4. Future-Normalisation: Calculating z-scores using the mean and standard deviation of the entire series, leaking the future into historical signals. The fix is strictly causal (rolling/expanding) normalisation or in-sample-frozen statistics.
  5. No Error Bars: Reporting a Sharpe as a single point estimate (e.g., 1.2). The book implements a stationary block bootstrap to produce a 95% confidence interval. If the lower bound is $\le 0$, the strategy is marked as unconfirmed and cannot be funded.

What NOT to Expect

To get the most out of this book, you must align your expectations with its pragmatic design:

1. No copy-paste "Alpha"

Do not read this book looking for a profitable trading strategy. The author is explicit: there is no alpha in this book. Specific parameters, instrument lists, and live performance metrics are either completely omitted or replaced with clearly-labelled illustrative values. The code blocks are sanitised, runnable-shaped patterns, not copy-paste recipes for printing money. The value of the book lies in the process and plumbing, which is precisely what is safe for the author to share.

2. No academic sanitisation

Academic papers often present algorithms and structures as if they are perfect, complete, and correct. This book does the opposite. In Part VII (Caveats, open problems & what we'd do differently), Dr. Azhari lists the structural regrets of the current Titan stack.

You will read about:

  • The Currency Seam: The ongoing operational difficulty of reconciling USD-denominated strategies with an account-currency net-liquidation value (NLV) that drifts due to FX rates, financing fees, and commissions.
  • Exceedance Correlation: How the joint risk-of-ruin Monte Carlo model uses unconditional correlations, which inevitably understates joint tail risk during market crises when correlations spike towards 1.
  • Shadow Control Traps: The risk of running safety controls (like leverage throttles or drawdown halts) in "shadow mode" for too long, treating them as armed controls when they are actually just passive logs.

3. No generic get-rich-quick advice

This is not a book that promises trading is easy or that you can run a system from your laptop in your spare time. It treats systematic trading as a high-stakes engineering problem. The callouts are colour-coded: !!! warning for anything that can corrupt a backtest result, and !!! danger for anything that can destroy live capital. It is an engineering manual for builders who want to treat their capital with the respect it deserves.


The Bottom Line

Dr. Rayan Azhari's Building a Production Quant Trading System is the book that fills the massive void between quantitative finance theory and live software operations. It won't give you a strategy to beat the market, but it will give you the tools, testing framework, and architectural discipline to ensure that when you do find an edge, your own code won't be the thing that kills it.

For any developer looking to cross the chasm from backtest to production, it is a guide written in the only language that matters: the scars of live capital.

Parts I and II (Foundations, and Research & Validation) are free to read online, so you can judge the approach before you commit; the complete book, Parts III to VII plus the appendices, is a paid edition, sold as a living digital copy (PDF and EPUB) on Leanpub and as a print paperback on Amazon. The companion titan/ framework stays open source under Apache-2.0.


Key Information & Companion Code

  • Author: Dr. Rayan Azhari
  • Companion Framework: The open-source titan/ package and testing scripts are available under the Apache-2.0 licence on GitHub.
  • Reading the book: Parts I and II are free to read at rayanazhari.co.uk. The complete book (Parts III to VII plus the appendices) is a paid edition: a digital copy on Leanpub, and a print paperback via Amazon. Book content is all rights reserved; the companion code stays Apache-2.0.
  • Disclaimer: Educational material only. Not investment advice. Trading involves a substantial risk of loss.

Related posts

I Stopped Paying for WordPress Hosting

Managed WordPress hosting is a tax you pay in money, in performance, and in security anxiety. Here is how I kept the WordPress editor I love, ran it locally for free, and served the public site as static HTML on the edge: a zero-dependency Node crawler I have open-sourced.

· 7 min

The Knowledge Escalator

How an ordinary teenager came to out-know Ptolemy, and why the same structural progress makes every one of us more ignorant than anyone who has ever lived. Hand a modern fifteen-year-old a blank sheet of paper and ask them to map the architecture of the cosmos, and they will sketch, without a moment’s hesitation, a

· 14 min

Essays in your inbox

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

Unsubscribe anytime. Read by 4,200+ professionals.