Markets and trading · Edition No. 22 · 16 Sep 2026

nkaz001/hftbacktest

A backtester that models your place in the order queue and the delay before your order reaches the venue.

← Markets and tradingRead the whole edition →

4.6k stars · MIT · rust-v0.9.4 (2025-12-10) · Track this in Scout

Latency- and queue-aware backtesting with full order-book simulation — the right shape for a scalping strategy, where naive backtests flatter hardest.

Repo detailsthe review · specs · pros & cons · install

What it is

A high-frequency trading backtesting library written in Rust with a Python interface. It replays full order-book data rather than candles, tracks where your order sits in the queue at each price level, and applies configurable delays for sending an order and receiving a response. The same code can then be used to run the strategy live.What it is good for. Anyone testing a strategy whose profit per trade is small. The problem it removes is a backtest that looks profitable and is not, because it quietly assumed a perfect fill. ScalpingMate is exactly that case: a scalping strategy on EUR/USD lives or dies on fills and delay, and Edition 21's PyBroker, which is good at telling you how much of a result is luck, does not model either. Two honest cautions. Its data tooling is built around cryptocurrency exchanges, so OANDA data means writing your own conversion. And it is the heaviest thing on this page.

Stars4.6k
LicenceMIT
Latestrust-v0.9.4 (2025-12-10)checked 7 Sep 2026
Written inRust
Good
  • Queue position and latency are modelled properly, which is the whole difference between a fast strategy on paper and in the market.
  • The Rust core is fast enough to replay months of order-book data.
  • MIT licence, and the same code path runs the live strategy, so the test and the real thing cannot drift apart.
Watch for
  • You supply the data, in its format. For forex that is a real project before you test anything.
  • It is built for order-book venues, and its examples are cryptocurrency exchanges.
  • The newest release is rust-v0.9.4 and py-v2.4.4 from 10 December 2025, and the year was confirmed on PyPI. That is nine months, which is well inside the line, but it is the quietest project in today's twelve.
Similar repositories
Install
python3 -m venv venv
source venv/bin/activate
pip install hftbacktest
# The Rust crate, if you want the fast path:
cargo add hftbacktest
# It ships no data. You convert your own order-book recordings
# into its format first; the guide is at
#   https://hftbacktest.readthedocs.io
Screenshots
nkaz001/hftbacktest: GitHub preview card

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.