From 69eb366bf99d820db1eded8ff20bfe5d9439ac8d Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Wed, 15 Apr 2026 21:48:32 +0000 Subject: [PATCH] fix: backtest simulation uses ET timezone for trading window The simulated timestamp was 10:00 UTC (6:00 AM ET) which is outside the trading window. Changed to 11:00 AM ET so backtested decisions actually pass the trading window check. --- services/trading/backtest_replay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/trading/backtest_replay.py b/services/trading/backtest_replay.py index c7578d1..4f85c7b 100644 --- a/services/trading/backtest_replay.py +++ b/services/trading/backtest_replay.py @@ -109,12 +109,14 @@ class BacktestReplay: # Process recommendations for this day for rec in day_recs: # Set a timestamp within trading window for evaluation + # Use 11:00 AM ET (within trading window) for simulation + from services.trading.trading_window import ET sim_time = datetime( current_date.year, current_date.month, current_date.day, - 10, 0, 0, - tzinfo=timezone.utc, + 11, 0, 0, + tzinfo=ET, ) decision = engine.evaluate_recommendation(