From 102cfcbe5b21dd95e73616e78b9d1b0dac7af55b Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Tue, 12 Nov 2013 12:43:35 -0500 Subject: [PATCH] BUG: Fix bad dates from test factory. Passing the exchange time timestamp to is_market_hours was ending up with odd behavior due to conversion back to UTC when checking the is_trading_day boolean. --- zipline/utils/factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/utils/factory.py b/zipline/utils/factory.py index 41dbfe3b..3d27d14c 100644 --- a/zipline/utils/factory.py +++ b/zipline/utils/factory.py @@ -139,7 +139,7 @@ def get_next_trading_dt(current, interval): next_dt = next_dt + interval next_dt = pd.Timestamp(next_dt, tz=trading.environment.exchange_tz) next_dt_utc = next_dt.tz_convert('UTC') - if trading.environment.is_market_hours(next_dt): + if trading.environment.is_market_hours(next_dt_utc): break next_dt = next_dt_utc.tz_convert(trading.environment.exchange_tz)