nkaz001 / hftbacktest

A high-frequency trading and market-making backtesting and trading bot in Python and Rust, which accounts for limit orders, queue positions, and latencies, utilizing full tick data for trades and order books, with real-world crypto market-making examples for Binance Futures
MIT License
2.02k stars 397 forks source link

Master not building #119

Open tradflux opened 3 months ago

tradflux commented 3 months ago

Looks like there are L3-unstable imports in backtest/mod.rs without the feature flag enabled.

py-hftbacktest$ maturin build

results in;

error: could not compile hftbacktest (lib) due to 1 previous error; 4 warnings emitted 💥 maturin failed Caused by: Failed to build a native library through cargo

The reported error is;

`error[E0432]: unresolved imports crate::backtest::models::L3QueueModel, crate::backtest::proc::L3Local, crate::backtest::proc::L3NoPartialFillExchange --> hftbacktest/src/backtest/mod.rs:12:18 12 models::{L3QueueModel, LatencyModel, QueueModel}, ^^^^^^^^^^^^ no L3QueueModel in backtest::models ... 15 L3Local, ^^^^^^^ no L3Local in backtest::proc 16 L3NoPartialFillExchange, ^^^^^^^^^^^^^^^^^^^^^^^ no L3NoPartialFillExchange in backtest::proc

note: trait crate::backtest::models::queue::L3QueueModel exists but is inaccessible --> hftbacktest/src/backtest/models/queue.rs:378:1 | 378 | pub trait L3QueueModel { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible note: found an item that was configured out`

tradflux commented 3 months ago

You can successfully build by adding this line to the cargo.toml

hftbacktest = { path = "../hftbacktest", features = ["backtest", "unstable_l3"] }

bohblue2 commented 3 months ago

This problem happened for me.

and this worked for me

hftbacktest = { path = "../hftbacktest", features = ["backtest", "unstable_l3"] }