From 3e4270729b60d8ee9d911e91525d4de304c1b883 Mon Sep 17 00:00:00 2001 From: boris Date: Sun, 5 Jul 2026 02:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPlatform=E9=80=89=E8=82=A1?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E9=A3=8E=E6=8E=A7=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_expr_strategy.rs | 47 ++++++++----------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index c1de838..457e932 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -5947,19 +5947,13 @@ impl PlatformExprStrategy { let Some(market) = ctx.data.market(date, &factor.symbol) else { continue; }; - if !ctx.is_lagged_execution() { - if let Some(reason) = self.selection_risk_rejection_reason( - ctx, - date, - &factor.symbol, - candidate, - market, - ) { - if !(defer_limit_state_selection_risk - && matches!(reason, "upper_limit" | "lower_limit")) - { - continue; - } + if let Some(reason) = + self.selection_risk_rejection_reason(ctx, date, &factor.symbol, candidate, market) + { + if !(defer_limit_state_selection_risk + && matches!(reason, "upper_limit" | "lower_limit")) + { + continue; } } if !self.stock_passes_universe_exclude(candidate, market) { @@ -5991,9 +5985,6 @@ impl PlatformExprStrategy { date: NaiveDate, factor_date: NaiveDate, ) -> Vec { - if ctx.is_lagged_execution() { - return Vec::new(); - } let mut decisions = Vec::new(); for factor in ctx.data.factor_snapshots_on(factor_date) { if ctx.has_dynamic_universe() && !ctx.dynamic_universe_contains(&factor.symbol) { @@ -14636,7 +14627,7 @@ mod tests { } #[test] - fn platform_next_open_selection_ignores_decision_day_static_risk_state() { + fn platform_next_open_selection_applies_decision_day_static_risk_state() { let factor_date = d(2023, 11, 10); let decision_date = d(2023, 11, 13); let execution_date = d(2023, 11, 14); @@ -14805,7 +14796,7 @@ mod tests { decision .diagnostics .iter() - .any(|item| item == "selected_symbols=600462.SH"), + .any(|item| item == "selected_symbols="), "{:?}", decision.diagnostics ); @@ -14813,20 +14804,20 @@ mod tests { decision .diagnostics .iter() - .all(|item| !item.contains("600462.SH rejected by")), + .any(|item| item.contains("risk_decisions selection_total=1 by_rule=paused:1")), "{:?}", decision.diagnostics ); assert!( - decision.order_intents.iter().any(|intent| match intent { - OrderIntent::Shares { - symbol, quantity, .. - } => symbol == candidate_symbol && *quantity > 0, - OrderIntent::Value { symbol, value, .. } => { - symbol == candidate_symbol && *value > 0.0 - } - _ => false, - }), + decision.order_intents.iter().all(|intent| !matches!( + intent, + OrderIntent::Shares { symbol, quantity, .. } + if symbol == candidate_symbol && *quantity > 0 + ) && !matches!( + intent, + OrderIntent::Value { symbol, value, .. } + if symbol == candidate_symbol && *value > 0.0 + )), "{:?}", decision.order_intents );