Skip to content

Commit

Permalink
Port market order filling for OrderMatchingEngine in Rust (#2202)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipmacek authored Jan 12, 2025
1 parent d4c9d2b commit 1585af0
Show file tree
Hide file tree
Showing 5 changed files with 573 additions and 58 deletions.
8 changes: 6 additions & 2 deletions nautilus_core/backtest/src/matching_engine/ids_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl IdsGenerator {
self.execution_count = 0;
}

fn get_venue_order_id(&mut self, order: &OrderAny) -> anyhow::Result<VenueOrderId> {
pub fn get_venue_order_id(&mut self, order: &OrderAny) -> anyhow::Result<VenueOrderId> {
// check existing on order
if let Some(venue_order_id) = order.venue_order_id() {
return Ok(venue_order_id);
Expand All @@ -83,7 +83,11 @@ impl IdsGenerator {
Ok(venue_order_id)
}

fn get_position_id(&mut self, order: &OrderAny, generate: Option<bool>) -> Option<PositionId> {
pub fn get_position_id(
&mut self,
order: &OrderAny,
generate: Option<bool>,
) -> Option<PositionId> {
let generate = generate.unwrap_or(true);
if self.oms_type == OmsType::Hedging {
{
Expand Down
Loading

0 comments on commit 1585af0

Please sign in to comment.