From 1f176de497d4a4de28d36d745d24ad8f7add62f9 Mon Sep 17 00:00:00 2001 From: Andrew Daniels Date: Sat, 26 Nov 2016 21:12:12 -0500 Subject: [PATCH] MAINT: Improve minute writer handling of non-trading minutes (#1602) Previously, if input to the BcolzMinuteBarWriter had the first bar on a non-trading minute, the next trading session would be considered the "first day" in the input. Now, we consider the previous trading session the "first day". The intention is to correctly associate minutes after official trading hours on half days with session that closed early, not the following session (a future improvement here would be to not accept minutes outside trading hours). --- zipline/data/minute_bars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/data/minute_bars.py b/zipline/data/minute_bars.py index 7c317053..c2d44c45 100644 --- a/zipline/data/minute_bars.py +++ b/zipline/data/minute_bars.py @@ -754,7 +754,7 @@ class BcolzMinuteBarWriter(object): tds = self._session_labels input_first_day = self._calendar.minute_to_session_label( - pd.Timestamp(dts[0])) + pd.Timestamp(dts[0]), direction='previous') last_date = self.last_date_in_output_for_sid(sid)