Leanpub Header

Skip to main content

Precision Time for Trading Systems in C++

PTP, Hardware Timestamping and Clock Synchronization for Nanosecond Event Ordering.

Precision Time for Trading Systems in C++
This book is 85% completeLast updated on 2026-11-14

Your markouts say the strategy has edge. Your latency dashboard says you’re fast. Your backtest agrees with both.

Then two hosts turn out to disagree by four microseconds, and none of those numbers mean what you thought.

Precision Time for Trading Systems in C++ shows you how to make every timestamp on your desk defensible: PTP, hardware timestamping, TSC calibration, and nanosecond event ordering, in production C++. You’ll know what happened first, how long it took, and how you can prove it.

If your edge is measured in microseconds, your clocks are part of your strategy.

Minimum price

$29.99

$39.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Your timestamps are lying to your P&L.

Every number your desk trusts rests on a clock. That includes your markouts, your tick-to-trade, your fill attribution, and the replays you backtest against. When those clocks disagree by a few microseconds, the numbers don’t fail loudly. They drift quietly. A fill gets booked against the wrong book state, a strategy’s edge looks like latency, and a backtest built from captured data rewards behaviour that live trading punishes.

Most firms find out the hard way: in a fill dispute, a post-trade investigation that can’t sequence its own events, or a regulator asking for evidence nobody kept.

This book is the fix, written for people who already know why a microsecond matters.

What you get:

  • Defensible event ordering across hosts and venues. You’ll know which came first, and when the clocks can’t tell you, you’ll know that too.
  • Latency attribution you can trust. Separate wire, kernel, application and venue time, with an honest uncertainty bound on every interval.
  • Clean capture and replay. Hardware timestamps on every packet, so your research data matches what your strategies actually saw.
  • A timing chain that fails safe. PTP, boundary clocks, GNSS holdover and failover, plus monitoring that downgrades bad timestamps before they reach your analysis.
  • Audit-grade evidence. Tamper-evident, per-minute proof that your clocks met their limits during any window anyone asks about.
  • Production C++20/23 throughout. Zero-overhead TSC timestamping, division-free nanosecond conversion, uncertainty-aware stream merging, and hybrid logical clocks. You also get complete linuxptp and chrony configurations ready to deploy.

Who it’s for: senior quants, trading-systems leads, and low-latency engineers who make decisions on the numbers their timestamps produce.

No theory padding and no vendor pitch, just the mechanisms, the failure modes and the code.

If your edge is measured in microseconds, your clocks are part of your strategy. Get them right.

Bundle

Bundles that include this book

Author

About the Author

Weston Ashgrove

Weston Ashgrove is a C++ systems engineer who builds software where being wrong or slow has a cost. He came up through quantitative trading, building order books, matching logic and the low-latency infrastructure underneath them and now brings the same discipline to performance engineering, concurrency, storage, networking, GPUs, and AI inference.

His rule for performance-critical code is simple: nothing is true until it has been profiled, fuzzed, and replayed. Every technique in his books comes with the measurement that proves it, the trade-off it costs, and the failure it prevents. He writes for working engineers who ship and debug production C++, and he leaves out anything that only works on a slide.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub