Wire futures order intents into engine
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user