Backtesting that accounts for feed latency, order latency, and queue position

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

Market-making strategies backtested with HftBacktest should produce live results that actually match simulations, because it models queue position and latency instead of assuming instant fills.

Read this as

HftBacktest is a free, open-source tool for testing high-frequency trading strategies before risking real money. Most backtesting software pretends your orders fill instantly, which makes results look far better than reality. This tool instead simulates how fast market data and your orders travel, and where you stand in the exchange's waiting line. It matters to people building fast, automated trading strategies that depend on tiny profit margins.

Most backtesting tools overstate trading profits by assuming instant order fills, so strategies that looked profitable in testing lose money live. HftBacktest, an open-source project by developer nkaz001, models data delays, order delays, and queue position to shrink that gap. It supports live trading on Binance Futures and Bybit. Relevant to firms running market-making strategies; irrelevant to slower, daily-bar trading.

HftBacktest rebuilds the full order book from Level-2 Market-By-Price and Level-3 Market-By-Order data and replays tick events through a Numba JIT-compiled engine. Feed, order latency, and queue position models are pluggable. Python (3.11+, pip install) and Rust share the same algorithmic core; Rust also supports live trading on Binance Futures and Bybit. It supports multi-asset, multi-exchange simulation; the article gives no benchmark numbers.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

HftBacktest Numba Binance Futures Bybit Python Rust nkaz001

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading