diff --git a/crates/fidc-core/src/broker.rs b/crates/fidc-core/src/broker.rs index a9a874a..39c1edf 100644 --- a/crates/fidc-core/src/broker.rs +++ b/crates/fidc-core/src/broker.rs @@ -427,10 +427,11 @@ where symbol: &str, snapshot: &crate::data::DailyMarketSnapshot, ) -> f64 { - 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.matching_type == MatchingType::NextBarOpen + && snapshot.prev_close.is_finite() + && snapshot.prev_close > 0.0 + { + return snapshot.prev_close; } if self.aiquant_execution_rules && self.execution_price_field == PriceField::Last { let start_cursor = self @@ -7153,7 +7154,7 @@ mod tests { } #[test] - fn next_open_target_value_valuation_uses_execution_open() { + fn next_open_target_value_valuation_uses_previous_close() { let date = chrono::NaiveDate::from_ymd_opt(2025, 1, 2).expect("valid date"); let broker = BrokerSimulator::new_with_execution_price( ChinaAShareCostModel::default(), @@ -7180,7 +7181,7 @@ mod tests { assert_eq!( broker.target_value_valuation_price(date, &data, "000001.SZ", snapshot), - 11.0 + 10.0 ); }