nkaz001/hftbacktest

Free, open source, a high frequency trading and market making backtesting and trading bot, which accounts for limit orders, queue positions, and latencies,...

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 22 minutes ago
Added to GitGenius on September 14th, 2026
Created on August 25th, 2022
Open Issues & Pull Requests: 18 (+0)
GitHub issues: Enabled
Number of forks: 911
Total Stargazers: 4,740 (+1)
Total Subscribers: 78 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 11.6 hours
Mean response time: 38.4 hours
90th percentile: 2.4 days
Tracked items: 127

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 232 days
Stale 30+ days: 3
Stale 90+ days: 1

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • Stale (50)
  • question (10)
  • bug (6)
  • enhancement (3)
  • documentation (1)
  • pinned (1)

Detailed Description

HftBacktest is a high-frequency trading and market making backtesting engine that simulates trading strategies with tick-by-tick accuracy using full order book and trade data.

The tool addresses the challenge of accurately simulating real-world trading conditions for high-frequency strategies. Traditional backtesting often oversimplifies execution by ignoring latencies and queue positions, leading to results that diverge significantly from live performance. HftBacktest reconstructs full order books from Level-2 and Level-3 market data, simulates both feed and order latencies with customizable models, and accounts for queue position when determining order fills. This tick-by-tick approach with configurable time intervals allows strategies to be tested under conditions that closely mirror actual market replay.

The tool suits traders and quants developing high-frequency or market-making strategies who need confidence that backtest results will translate to live performance. It handles multi-asset and multi-exchange scenarios, making it applicable to complex portfolio strategies. The framework supports Python development through Numba JIT compilation for performance, while also offering Rust for live trading deployment on Binance Futures and Bybit. Developers should adopt this tool if they operate in competitive markets where small edges matter and cannot afford the gap between backtest and live results that simpler simulators introduce.

The project maintains active development across both Python and Rust implementations, with documentation including practical tutorials on grid trading, market making with alpha signals, and accelerated backtesting techniques. The codebase demonstrates ongoing refinement of simulation accuracy and expansion of supported exchanges for live trading deployment.