From 64298f09c1bc66f4ad66208ac85a5b0ba77c6806 Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 6 Jul 2026 10:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=B6=A8=E5=81=9C=E6=8C=81?= =?UTF-8?q?=E4=BB=93=E5=BB=B6=E8=BF=9F=E5=8D=96=E5=87=BA=E6=89=93=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_expr_strategy.rs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index b047cf0..08fe495 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -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]