From 27e523a1dc053059550fad8798c00437f8d4c044 Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 7 Sep 2026 03:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=85=E5=9C=A8=E6=88=90=E5=8A=9F=E6=B8=85?= =?UTF-8?q?=E4=BB=93=E5=90=8E=E9=87=8A=E6=94=BE=E7=9B=AE=E6=A0=87=E6=9D=83?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_expr_strategy.rs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index fef4e15..d785685 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -12533,7 +12533,7 @@ impl Strategy for PlatformExprStrategy { } let stop_take_exit_signal_symbols = current_stop_take_exit_symbols.clone(); - let target_portfolio_weights = + let original_target_weights = if self.config.target_portfolio_daily_enabled && selection_limit > 0 { let mut scales = Vec::new(); let original_target_symbols = self @@ -12557,18 +12557,16 @@ impl Strategy for PlatformExprStrategy { )?; scales.push((symbol.clone(), self.buy_scale(ctx, &day, &decision_stock)?)); } - let original_weights = ordered_weight_bps_from_scales(&scales)?; - let mut excluded_target_symbols = exit_symbols.clone(); - excluded_target_symbols.extend(stop_take_exit_signal_symbols.iter().cloned()); - replenish_target_weight_bps( - &original_weights, - &stock_list, - &excluded_target_symbols, - selection_limit, - ) + ordered_weight_bps_from_scales(&scales)? } else { Vec::new() }; + let target_portfolio_weights = replenish_target_weight_bps( + &original_target_weights, + &stock_list, + &exit_symbols, + selection_limit, + ); let target_portfolio_weight_bps = target_portfolio_weights .iter() .cloned() @@ -13147,8 +13145,14 @@ impl Strategy for PlatformExprStrategy { } } + let daily_target_portfolio_weights = replenish_target_weight_bps( + &original_target_weights, + &stock_list, + &same_day_sold_symbols, + selection_limit, + ); if daily_top_up_active && self.config.target_portfolio_daily_enabled { - for (symbol, weight_bps) in &target_portfolio_weights { + for (symbol, weight_bps) in &daily_target_portfolio_weights { let target_value = strategy_visible_total_value * trading_ratio * f64::from(*weight_bps) / 10_000.0;