Inside Kestrel: Building a C++ Trading Platform

A code-level tour of Kestrel, a C++20 backtesting, paper and live trading platform for NSE, BSE and MCX on the FYERS API. We animate the engine's deterministic event loop, the fill and Indian cost models, Black-Scholes and IV surfaces, backtest metrics, and the multi-process services that handle market data, orders and live-trading safety. Educational only, not financial advice.

Lessons
26
Hours of video
5.5
Minutes of reading
258
Finished here
0
#LessonVideoReadStatus
1Kestrel in One Picture: One Engine, Three Modes12:3610 min
2Kestrel Build System: CMake Modules and a Zero-Comment Rule12:319 min
3Kestrel Core Vocabulary: Ticks, IST Time and the Run Config12:329 min
4The History Store: Bar Files That Never Corrupt (Kestrel Ep. 4)13:0311 min
5The Event Bus and K-Way Merge: Why Every Backtest Is Bit-Identical12:4510 min
6Inside Kestrel: The Per-Bar Pipeline, Derived Bars and Expiry12:0710 min
7Kestrel Alpha Framework: Interfaces, Gates and Target Positions12:5010 min
8OMS and Risk: Normalise, Check, Then Send (Kestrel Code Walkthrough)11:139 min
9Positions and P&L in C++: Average Cost, Flips and Futures Variation Margin11:4510 min
10The Simulated Venue: How Kestrel Fills Orders Without Lookahead12:2010 min
11The Indian Cost Model: Brokerage, STT, GST and Every Fee Per Fill13:1210 min
12Black-Scholes, Greeks and Implied Volatility by Bisection in C++12:3510 min
13Building an IV Surface: Parity Forward, Black-76, 25-Delta Wings12:389 min
14Backtest Metrics: Welford Sharpe, Sortino and Drawdown in C++13:1611 min
15Kestrel Backtest Jobs, Parameter Sweeps and Honest Walk-Forward14:0311 min
16Golden Tests, Fakes and the Run Archive: Proving a Trading Engine Unchanged14:0711 min
17Why Kestrel Runs as Many Processes: The Live Architecture12:019 min
18Wire Framing and Loopback Security: Inside Kestrel's Local Sockets14:0511 min
19Kestrel: A Bounded HTTP Server, dlopen libcurl, and a Hand-Built WebSocket12:5610 min
20Decoding the FYERS Binary Market-Data Protocol, Byte by Byte12:5510 min
21One Connection, Many Traders: Inside Kestrel's Market-Data Service12:049 min
22Kestrel Broker Plumbing: Daily Login, Secret Redaction, Rate Limiters11:119 min
23Safe Order Placement: When the Broker Doesn't Answer14:2412 min
24Kestrel Order Service: Sessions, Shadow Books, Crash Recovery11:009 min
25Ten Layers of Live-Trading Safety: Every Switch Before a Real Order11:499 min
26A Day in Paper Trading: Running a C++ Trading Stack, and 15 Lessons12:3310 min