From 754fc913769227bc3786a00099a8c51fa087d7c4 Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 1 Jul 2026 15:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3AiQuant=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=B0=83=E4=BB=93=E7=8E=B0=E9=87=91=E9=A2=84=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/platform_expr_strategy.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index bef9713..1c15e27 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -7968,7 +7968,11 @@ impl Strategy for PlatformExprStrategy { } aiquant_available_cash = projected.cash(); - let fixed_buy_cash = aiquant_total_value * trading_ratio / selection_limit as f64; + let fixed_buy_cash = if self.config.aiquant_transaction_cost { + aiquant_available_cash * trading_ratio / selection_limit as f64 + } else { + aiquant_total_value * trading_ratio / selection_limit as f64 + }; let target_budget = aiquant_total_value * trading_ratio; let mut rebalance_working_symbols = slot_working_symbols.clone(); if self.config.release_slot_on_exit_signal { @@ -18392,7 +18396,7 @@ mod tests { } #[test] - fn platform_aiquant_periodic_rebalance_uses_total_value_equal_weight_buy_budget() { + fn platform_aiquant_periodic_rebalance_uses_cash_divided_by_top_n_buy_budget() { let prev_date = d(2025, 5, 13); let date = d(2025, 5, 14); let retained_symbols = (1..=17) @@ -18591,7 +18595,7 @@ mod tests { assert!( decision.order_intents.iter().all(|intent| match intent { OrderIntent::Value { value, reason, .. } if reason == "periodic_rebalance_buy" => - (*value - 126_500.0).abs() < 1e-6, + (*value - 75_410.3).abs() < 1e-6, _ => true, }), "{:?}", @@ -18749,7 +18753,7 @@ mod tests { reason, } if symbol == "000002.SZ" && reason == "periodic_rebalance_buy" - && (*value - 10_000.0).abs() < 1e-6 + && (*value - 5_000.0).abs() < 1e-6 )), "{:?}", decision.order_intents