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.
- 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.
- 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.
edtechre/pybrokerTests strategies with machine learning and tells you how much of a result is luck, and models neither queue position nor delay.
Track this in Scout
kernc/backtesting.pyMuch simpler and much faster to learn, working on candles rather than the order book.
Track this in Scout
nautechsystems/nautilus_traderA full trading platform where the same code backtests and trades live, covering many asset classes and taking weeks to learn.
Track this in Scout
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
