From cbe135ed0da48fc47e23e20febb88fc4e3dd42d0 Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 4 Jul 2026 00:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85next-open=E6=98=9FST=E6=88=90?= =?UTF-8?q?=E4=BA=A4=E6=97=A5=E9=A3=8E=E6=8E=A7=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/engine.rs | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/crates/fidc-core/src/engine.rs b/crates/fidc-core/src/engine.rs index 0f223cc..e00fc18 100644 --- a/crates/fidc-core/src/engine.rs +++ b/crates/fidc-core/src/engine.rs @@ -4252,6 +4252,13 @@ mod tests { } } + fn star_st_candidate(date: NaiveDate) -> CandidateEligibility { + CandidateEligibility { + is_star_st: true, + ..candidate(date) + } + } + fn one_yuan_candidate(date: NaiveDate) -> CandidateEligibility { CandidateEligibility { is_one_yuan: true, @@ -4580,6 +4587,22 @@ mod tests { assert_eq!(result.fills[0].price, 12.0); } + #[test] + fn next_bar_open_execution_risk_ignores_decision_day_star_st_state() { + let first = d(2025, 1, 2); + let second = d(2025, 1, 3); + let result = run_scheduled_next_open_with_dataset(dataset_with( + market(first, 10.0, 11.5), + market(second, 12.0, 99.0), + star_st_candidate(first), + candidate(second), + )); + + assert_eq!(result.fills.len(), 1); + assert_eq!(result.fills[0].date, second); + assert_eq!(result.fills[0].price, 12.0); + } + #[test] fn next_bar_open_execution_risk_rejects_execution_day_paused_state() { let first = d(2025, 1, 2); @@ -4622,6 +4645,20 @@ mod tests { assert_next_open_canceled_with_reason(&result, "st"); } + #[test] + fn next_bar_open_execution_risk_rejects_execution_day_star_st_state() { + let first = d(2025, 1, 2); + let second = d(2025, 1, 3); + let result = run_scheduled_next_open_with_dataset(dataset_with( + market(first, 10.0, 11.5), + market(second, 12.0, 99.0), + candidate(first), + star_st_candidate(second), + )); + + assert_next_open_canceled_with_reason(&result, "star_st"); + } + #[test] fn next_bar_open_execution_risk_rejects_execution_day_one_yuan_state() { let first = d(2025, 1, 2);