Crate hftbacktest

Source
Expand description

§HftBacktest

This Rust framework is designed for developing and running high-frequency trading and market-making strategies. It focuses on accounting for both feed and order latencies, as well as the order queue position for order fill simulation. The framework aims to provide more accurate market replay-based backtesting, based on full order book and trade tick feed data. You can also run the live bot using the same algo code.

§Key Features

  • Complete tick-by-tick simulation with a variable time interval.
  • Full order book reconstruction based on L2 feeds(Market-By-Price) and L3 feeds(Market-By-Order).
  • Backtest accounting for both feed and order latency, using provided models or your own custom model.
  • Order fill simulation that takes into account the order queue position, using provided models or your own custom model.
  • Backtesting of multi-asset and multi-exchange models
  • Deployment of a live trading bot using the same algo code

§Feature flags

Currently, default enables backtest, live features.

  • backtest: Enables backtesting features.
  • live: Enables a live trading bot.
  • unstable_l3: Enables Level3 Market-By-Order backtesting.
  • unstable_fuse: Enables the market depth fusion feature, which aggregates different market depth streams to provide the finest granularity and the most frequent, up-to-date market depth information

Modules§

backtestbacktest
Provides backtesting features.
depth
Provides market depth implementations.
livelive
Provides live trading bot features.
prelude
Provides common types.
types
Defines HftBacktest types.