修正涨停持仓延迟卖出打标

This commit is contained in:
boris
2026-07-06 10:27:18 +08:00
parent 60bfa28ef0
commit 64298f09c1
+22 -2
View File
@@ -8890,6 +8890,26 @@ impl Strategy for PlatformExprStrategy {
if !explicit_action_intents.is_empty() {
order_intents.extend(explicit_action_intents);
}
if self.config.delayed_limit_open_exit_enabled {
let trade_time = self.intraday_execution_start_time();
for position in ctx.portfolio.positions().values() {
if position.quantity == 0 || delayed_sold_symbols.contains(&position.symbol) {
continue;
}
if matches!(
self.stock_is_at_upper_limit_at_time(
ctx,
projection_date,
&position.symbol,
trade_time,
)?,
Some(true)
) {
self.pending_highlimit_holdings
.insert(position.symbol.clone());
}
}
}
let mut diagnostics = vec![
if self.config.rotation_enabled {
@@ -14934,7 +14954,7 @@ mod tests {
}
#[test]
fn platform_aiquant_weak_market_sells_upper_limit_when_not_pending() {
fn platform_aiquant_weak_market_marks_upper_limit_but_allows_target_adjust() {
let prev_date = d(2023, 5, 4);
let date = d(2023, 5, 5);
let symbol = "600148.SH";
@@ -15087,7 +15107,7 @@ mod tests {
"{:?}",
decision.order_intents
);
assert!(!strategy.pending_highlimit_holdings.contains(symbol));
assert!(strategy.pending_highlimit_holdings.contains(symbol));
}
#[test]