From 438757ab546beb7f443a9e7c4017cb24bd56645e Mon Sep 17 00:00:00 2001 From: boris Date: Sun, 12 Jul 2026 05:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=AC=A1=E6=97=A5=E5=BC=80?= =?UTF-8?q?=E7=9B=98=E7=9B=AE=E6=A0=87=E5=B8=82=E5=80=BC=E6=8D=A2=E8=82=A1?= =?UTF-8?q?=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/broker.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/fidc-core/src/broker.rs b/crates/fidc-core/src/broker.rs index 39c1edf..a9a874a 100644 --- a/crates/fidc-core/src/broker.rs +++ b/crates/fidc-core/src/broker.rs @@ -427,11 +427,10 @@ where symbol: &str, snapshot: &crate::data::DailyMarketSnapshot, ) -> f64 { - if self.matching_type == MatchingType::NextBarOpen - && snapshot.prev_close.is_finite() - && snapshot.prev_close > 0.0 - { - return snapshot.prev_close; + if self.matching_type == MatchingType::NextBarOpen { + // The target budget is frozen on the signal day, but the broker can only + // convert that budget to shares once the next session's open is visible. + return self.sizing_price(snapshot); } if self.aiquant_execution_rules && self.execution_price_field == PriceField::Last { let start_cursor = self @@ -7154,7 +7153,7 @@ mod tests { } #[test] - fn next_open_target_value_valuation_uses_previous_close() { + fn next_open_target_value_valuation_uses_execution_open() { let date = chrono::NaiveDate::from_ymd_opt(2025, 1, 2).expect("valid date"); let broker = BrokerSimulator::new_with_execution_price( ChinaAShareCostModel::default(), @@ -7181,7 +7180,7 @@ mod tests { assert_eq!( broker.target_value_valuation_price(date, &data, "000001.SZ", snapshot), - 10.0 + 11.0 ); }