From 344e7e90c27f386cbac691082f2e00da76a87381 Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 8 Jul 2026 04:09:16 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=AD=A3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=8D=96=E5=87=BA=E6=A7=BD=E4=BD=8D=E8=AE=A1?= =?UTF-8?q?=E6=95=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c64bf16c8b6128c63c8eb06729d464435ffe165a. --- .../fidc-core/src/platform_expr_strategy.rs | 45 +++++-------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index 6a40ab2..8795fd2 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -8349,7 +8349,7 @@ impl Strategy for PlatformExprStrategy { .portfolio .positions() .keys() - .filter(|symbol| !same_day_sold_symbols.contains(*symbol)) + .filter(|symbol| !delayed_sold_symbols.contains(*symbol)) .cloned() .collect::>(); let daily_top_up_active = self.config.daily_top_up_enabled @@ -8739,6 +8739,7 @@ impl Strategy for PlatformExprStrategy { self.pending_full_close_symbols.remove(&position.symbol); } else { exit_symbols.insert(position.symbol.clone()); + slot_blocking_symbols.insert(position.symbol.clone()); order_intents.push(OrderIntent::TargetValue { symbol: position.symbol.clone(), target_value: 0.0, @@ -8773,37 +8774,6 @@ impl Strategy for PlatformExprStrategy { } else if stop_hit { unresolved_stop_loss_symbols.insert(position.symbol.clone()); } - if daily_top_up_active { - self.try_daily_top_up_at_position( - ctx, - &day, - &stock_list, - decision_date, - execution_date, - projection_date, - selection_factor_date, - signal_date, - daily_top_up_target_budget, - selection_limit, - defer_execution_risk, - Some(position.symbol.as_str()), - &mut projected, - &mut projected_execution_state, - &mut order_intents, - &mut aiquant_available_cash, - &mut slot_working_symbols, - &mut same_bar_buy_symbols, - &pending_full_close_symbols, - &slot_blocking_symbols, - &same_day_sold_symbols, - &exit_symbols, - &delayed_sold_symbols, - &mut intraday_attempted_buys, - &mut daily_top_up_pending_buy_value, - debug_daily_top_up, - &mut daily_top_up_debug_notes, - )?; - } continue; } } @@ -21832,7 +21802,7 @@ mod tests { } #[test] - fn platform_aiquant_carried_full_close_releases_slot_when_flat() { + fn platform_aiquant_carried_full_close_does_not_release_new_top_up_slot() { let prev_date = d(2025, 4, 29); let date = d(2025, 4, 30); let buy_first = "000001.SZ"; @@ -22016,7 +21986,12 @@ mod tests { ); assert_eq!( top_up_symbols, - vec![buy_first, buy_second], + vec![buy_first], + "{:?}", + decision.order_intents + ); + assert!( + !top_up_symbols.contains(&buy_second), "{:?}", decision.order_intents ); @@ -22619,7 +22594,7 @@ mod tests { decision.order_intents ); assert!( - !decision.order_intents.iter().any(|intent| matches!( + decision.order_intents.iter().any(|intent| matches!( intent, OrderIntent::Value { symbol,