-
Notifications
You must be signed in to change notification settings - Fork 703
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
In the Rust backtest engine, Backtest::submit_order hard-codes Side::Sell and ignores the side field in OrderRequest. Any buy submitted via submit_order becomes a sell.
Evidence
File: hftbacktest/src/backtest/mod.rs
local.submit_order(
order.order_id,
Side::Sell, // ignores order.side
order.price,
order.qty,
order.order_type,
order.time_in_force,
self.cur_ts,
)?;Impact
Critical for users calling Bot::submit_order; buy orders are flipped. submit_buy_order/submit_sell_order are unaffected.
Repro (minimal)
- Create an
OrderRequest { side: Buy, ... } - Call
submit_order - Inspect
orders()-> the created order hasside == Sell
Expected
submit_order should pass order.side to local.submit_order.
nkaz001
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working