fix: retain precise missing execution quote diagnostics during risk checks
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user