diff --git a/apps/paper_trader/event_detector.py b/apps/paper_trader/event_detector.py index 6772cab..453aa65 100644 --- a/apps/paper_trader/event_detector.py +++ b/apps/paper_trader/event_detector.py @@ -135,15 +135,11 @@ class EventDetector: if not enriched.get("reaction_day_high"): enriched["reaction_day_high"] = sym_bars[rd].get("high") - # Compute market features from Oracle bars ONLY if missing in DB - # feature_json. DB values are authoritative because they were computed - # by the feature_builder at event time with the correct reaction_date - # and base price. Oracle bars can produce different values due to - # non-deterministic data or different date alignment. - _db_has_reaction = enriched.get("reaction_day_return") is not None + # Compute market features from Oracle bars if missing in DB feature_json. + # These can be None when the feature builder ran before reaction-day bars settled. sym_bars = bars_by_symbol.get(sym, {}) rd = _parse_date(enriched.get("reaction_date")) - if rd and rd in sym_bars and not _db_has_reaction: + if rd and rd in sym_bars: sorted_dates = sorted(sym_bars.keys()) try: rd_idx = sorted_dates.index(rd)