fix: retain precise missing execution quote diagnostics during risk checks

This commit is contained in:
boris
2026-09-11 09:14:58 +08:00
parent c32807db1d
commit d3c36e9478
+18 -18
View File
@@ -6166,6 +6166,24 @@ where
} else { } else {
rule rule
}; };
if (rule.allowed || rule.reason.as_deref() == Some("invalid execution price"))
&& let Some(missing_reason) =
self.missing_daily_execution_price_reason(snapshot, algo_request)
{
Self::reject_missing_execution_price_order(
report,
date,
order_id,
symbol,
OrderSide::Buy,
requested_qty,
reason,
missing_reason,
emit_creation_events,
);
self.clear_open_order(order_id);
return Ok(());
}
if !rule.allowed { if !rule.allowed {
let rule_reason = rule.reason.as_deref().unwrap_or_default().to_string(); let rule_reason = rule.reason.as_deref().unwrap_or_default().to_string();
let status = match rule.reason.as_deref() { let status = match rule.reason.as_deref() {
@@ -6202,24 +6220,6 @@ where
return Ok(()); return Ok(());
} }
if let Some(missing_reason) =
self.missing_daily_execution_price_reason(snapshot, algo_request)
{
Self::reject_missing_execution_price_order(
report,
date,
order_id,
symbol,
OrderSide::Buy,
requested_qty,
reason,
missing_reason,
emit_creation_events,
);
self.clear_open_order(order_id);
return Ok(());
}
let current_position_quantity = portfolio let current_position_quantity = portfolio
.position(symbol) .position(symbol)
.map(|position| position.quantity) .map(|position| position.quantity)