Wire futures order intents into engine

This commit is contained in:
boris
2026-04-23 20:38:36 -07:00
parent db4e385308
commit 3439b5d8d0
6 changed files with 214 additions and 14 deletions

View File

@@ -121,6 +121,14 @@ impl FuturesOrderIntent {
reason: reason.into(),
}
}
pub fn side(&self) -> OrderSide {
if self.effect == FuturesPositionEffect::Open {
self.direction.open_side()
} else {
self.direction.close_side()
}
}
}
#[derive(Debug, Clone, Default)]
@@ -505,11 +513,7 @@ impl FuturesAccountState {
intent: FuturesOrderIntent,
) -> FuturesExecutionReport {
let mut report = FuturesExecutionReport::default();
let side = if intent.effect == FuturesPositionEffect::Open {
intent.direction.open_side()
} else {
intent.direction.close_side()
};
let side = intent.side();
if intent.quantity == 0 || !intent.price.is_finite() || intent.price <= 0.0 {
report.order_events.push(OrderEvent {