diff --git a/crates/fidc-core/src/engine.rs b/crates/fidc-core/src/engine.rs index e00fc18..e491feb 100644 --- a/crates/fidc-core/src/engine.rs +++ b/crates/fidc-core/src/engine.rs @@ -4571,6 +4571,22 @@ mod tests { assert_eq!(result.fills[0].price, 12.0); } + #[test] + fn next_bar_open_execution_risk_ignores_decision_day_upper_limit_state() { + let first = d(2025, 1, 2); + let second = d(2025, 1, 3); + let result = run_scheduled_next_open_with_dataset(dataset_with( + market_with_state(first, 10.0, 10.0, false, 10.0, 1.0), + market_with_state(second, 12.0, 99.0, false, 200.0, 1.0), + 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_ignores_decision_day_st_state() { let first = d(2025, 1, 2);