保留AiQuant盘中卖出价格风控语义

This commit is contained in:
boris
2026-07-04 17:02:55 +08:00
parent 143a021067
commit a8ffd36150
2 changed files with 12 additions and 3 deletions
+9 -2
View File
@@ -2295,7 +2295,10 @@ where
position: &crate::portfolio::Position,
algo_request: Option<&AlgoExecutionRequest>,
) -> RuleCheck {
if self.risk_config.static_rules.respect_allow_buy_sell && !candidate.allow_sell {
if self.risk_config.static_rules.respect_allow_buy_sell
&& !self.aiquant_execution_rules
&& !candidate.allow_sell
{
return RuleCheck::reject("sell_disabled");
}
let check_price = if self.aiquant_execution_rules {
@@ -2310,6 +2313,10 @@ where
} else {
ChinaAShareRiskControl::sell_check_price(snapshot, self.execution_price_field)
};
let mut risk_config = self.risk_config.clone();
if self.aiquant_execution_rules {
risk_config.static_rules.respect_allow_buy_sell = false;
}
if let Some(reason) = ChinaAShareRiskControl::sell_rejection_reason_with_config(
date,
candidate,
@@ -2317,7 +2324,7 @@ where
instrument,
Some(position),
check_price,
&self.risk_config,
&risk_config,
) {
return RuleCheck::reject(reason);
}