Skip to content

Commit

Permalink
fix(rust): fix the order id type in FusedHashMapMarketDepth.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaz001 committed Jul 24, 2024
1 parent 69f2f77 commit 12278ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hftbacktest/src/depth/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::{ApplySnapshot, L1MarketDepth, L3Order, MarketDepth, INVALID_MAX, INV
use crate::{
backtest::{reader::Data, BacktestError},
prelude::{L2MarketDepth, Side, DEPTH_SNAPSHOT_EVENT, EXCH_EVENT, LOCAL_EVENT},
types::{Event, BUY, SELL},
types::{Event, OrderId, BUY, SELL},
};

struct QtyTimestamp {
Expand Down Expand Up @@ -44,7 +44,7 @@ pub struct FusedHashMapMarketDepth {
pub best_ask_timestamp: i64,
pub low_bid_tick: i64,
pub high_ask_tick: i64,
pub orders: HashMap<i64, L3Order>,
pub orders: HashMap<OrderId, L3Order>,
}

#[inline(always)]
Expand Down Expand Up @@ -389,6 +389,9 @@ impl ApplySnapshot<Event> for FusedHashMapMarketDepth {
local_ts: 0,
px: px_tick as f64 * self.tick_size,
qty: qty.qty,
order_id: 0,
ival: 0,
fval: 0.0,
});
}

Expand All @@ -406,6 +409,9 @@ impl ApplySnapshot<Event> for FusedHashMapMarketDepth {
local_ts: 0,
px: px_tick as f64 * self.tick_size,
qty: qty.qty,
order_id: 0,
ival: 0,
fval: 0.0,
});
}

Expand Down

0 comments on commit 12278ae

Please sign in to comment.