fix: distinguish signal consumption and strategy decision schedule dates

This commit is contained in:
boris
2026-09-10 21:20:43 +08:00
parent c8f6ed102c
commit 3dd7b2bd50
2 changed files with 10 additions and 11 deletions
+3 -3
View File
@@ -185,9 +185,9 @@ impl ValidatedSignalBook {
Ok(snapshot)
}
pub fn is_due_on(&self, ctx: &StrategyContext<'_>) -> bool {
self.index.range(ctx.execution_date.and_hms_opt(0,0,0).expect("session start")..)
.next().is_some_and(|(at,_)|at.date()==ctx.execution_date)
pub fn is_due_on(&self, execution_date: NaiveDate) -> bool {
self.index.range(execution_date.and_hms_opt(0,0,0).expect("session start")..)
.next().is_some_and(|(at,_)|at.date()==execution_date)
}
fn snapshot_at(&self, execution_date: NaiveDate, current_time: Option<NaiveTime>, lagged: bool) -> Result<&SignalSnapshot, String> {