From 6e9dc6e5524cdd192af0d40de3084061ac6c0c70 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Sun, 11 May 2014 19:28:32 +0530 Subject: [PATCH] BUG: Use env_trading_calender for open and closes data TradingEnvironment class uses env_trading_calendar for trading days, but the default trading calendar for open_and_close data, which causes errors later, because of misalignment of trading days. The issue can be resolved by using env_trading_calendar for open_and_closes as well --- zipline/finance/trading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/finance/trading.py b/zipline/finance/trading.py index b7f39402..f4ace1f5 100644 --- a/zipline/finance/trading.py +++ b/zipline/finance/trading.py @@ -116,7 +116,7 @@ class TradingEnvironment(object): self.early_closes = get_early_closes(self.first_trading_day, self.last_trading_day) - self.open_and_closes = tradingcalendar.open_and_closes.ix[ + self.open_and_closes = env_trading_calendar.open_and_closes.ix[ self.trading_days] def __enter__(self, *args, **kwargs):