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.
This commit is contained in:
@@ -109,12 +109,14 @@ class BacktestReplay:
|
|||||||
# Process recommendations for this day
|
# Process recommendations for this day
|
||||||
for rec in day_recs:
|
for rec in day_recs:
|
||||||
# Set a timestamp within trading window for evaluation
|
# 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(
|
sim_time = datetime(
|
||||||
current_date.year,
|
current_date.year,
|
||||||
current_date.month,
|
current_date.month,
|
||||||
current_date.day,
|
current_date.day,
|
||||||
10, 0, 0,
|
11, 0, 0,
|
||||||
tzinfo=timezone.utc,
|
tzinfo=ET,
|
||||||
)
|
)
|
||||||
|
|
||||||
decision = engine.evaluate_recommendation(
|
decision = engine.evaluate_recommendation(
|
||||||
|
|||||||
Reference in New Issue
Block a user