diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 4d11d4a1b8..0117cb6218 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -517,11 +517,12 @@ def _create_clock(self): self.trading_calendar.execution_time_from_close(market_closes) execution_opens = execution_closes - # FIXME generalize these values + # call 1 hour before before trading open + cal_market_open = self.trading_calendar.open_times[0][1] before_trading_start_minutes = days_at_time( self.sim_params.sessions, - time(8, 45), - "US/Eastern" + time(cal_market_open.hour-1, cal_market_open.minute), + self.trading_calendar.tz ) return MinuteSimulationClock(