Skip to content
Pro

Trading Systems and Quantitative Finance in C++

Order books, matching engines, option pricing and back-testing, built from scratch

Level: Intermediate to advanced · 12 lessons · about 18 hours

What you will be able to do

  • Build a limit order book and a matching engine with price-time priority, and test its invariants
  • Parse binary market data into typed events without copying and detect sequence gaps
  • Represent prices and money exactly, and explain why double is the wrong tool
  • Price options with binomial trees, Black-Scholes and Monte Carlo, and check the three against each other
  • Compute volatility, drawdown, Value at Risk and expected shortfall from a return series
  • Back-test a strategy without look-ahead bias, and recognize overfitting when you see it
  • Reason about a latency budget and measure design choices by counting

Who it is for

  • Developers preparing for engineering roles at trading firms, exchanges and brokers
  • Quant developers who want to see how pricing code and trading infrastructure fit together
  • Finance and maths students who can program and want to turn formulas into working code
  • Engineers curious how an exchange actually matches orders

Before you start

The course project

You build a miniature exchange and strategy lab: an order book and matching engine, a binary feed handler, pre-trade risk checks and a back-tester, all driven by a deterministic synthetic market. The last lesson wires them into one replayable simulation. Everything uses synthetic data; nothing in the course is a trading recommendation.

Lessons

  1. 1The Limit Order Book: Price-Time PriorityFree sampleHow an exchange keeps waiting buy and sell orders, decides who trades first, and how to build that book in C++ with integer prices and checkable invariants.35 min
  2. 2A Matching Engine: Limit, Market and Cancel OrdersTurn the order book into an engine that trades, with fills at the resting price, partial fills, market orders and cancels, then prove it right against a slow reference.35 min
  3. 3Order Types, Time-in-Force and Pre-Trade ChecksAdd IOC, FOK, day and post-only orders to the engine, validate every order before it reaches the book, prevent self-trades, enforce risk limits and compute an auction price.35 min
  4. 4Parsing Market Data: Binary Protocols Without CopiesDecode a binary market-data feed into typed events with bounds-checked reads, explicit byte order and no struct casts, then rebuild the book and recover from gaps.40 min
  5. 5Event-Driven Design: Strategies, Gateways and Deterministic ReplayStructure a trading system as one ordered event log processed by a single-threaded core, so that any run can be replayed bit for bit, then find the hidden sources of nondeterminism.30 min
  6. 6Money in C++: Fixed-Point Prices, Rounding and OverflowRepresent prices and money as scaled integers with a small Fixed type, choose rounding modes deliberately, multiply without overflow, and test it all against 128-bit arithmetic.35 min
  7. 7Returns, Volatility and Risk MetricsTurn a price series into returns, measure volatility without losing digits, and compute drawdown, Sharpe ratio, Value at Risk and expected shortfall, with every convention stated.40 min
  8. 8Option Pricing I: Binomial TreesPrice European and American options with a Cox-Ross-Rubinstein tree, check every result against put-call parity and no-arbitrage bounds, and watch the tree converge to Black-Scholes.35 min
  9. 9Option Pricing II: Black-Scholes, Greeks and Implied VolatilityImplement the Black-Scholes formula with std::erfc, verify every Greek by bump-and-reprice, and invert prices to implied volatility with bisection and safeguarded Newton.40 min
  10. 10Monte Carlo Simulation: Pricing Paths, Variance and Reproducible RandomnessPrice options by simulating thousands of price paths, report every estimate with a standard error, cut that error with antithetic and control variates, and keep every run reproducible.40 min
  11. 11Back-Testing a Strategy HonestlyBuild a bar-by-bar back-tester with next-bar fills and costs, then use pure random walks to watch look-ahead, survivorship and overfitting manufacture results out of noise.45 min
  12. 12The Latency Budget: Measuring, Cache Behavior and What to OptimizeReason about tail latency and coordinated omission, compare book layouts by counted cache misses and allocations, then wire the course's pieces into one deterministic, replayable simulation.35 min