Clean up daily bar reader/writer to take advantage of new trading calendar. The reader

is backwards-compatible with the previous format.

In USEquityLoader, use dailyreader's trading_calendar.

This is backwards compatible and will fall back to the NYSE calendar if
the reader doesn’t have a calendar specified.
This commit is contained in:
Jean Bredeche
2016-07-15 15:13:57 -04:00
parent e0f6abda2e
commit 5a0f840917
9 changed files with 104 additions and 34 deletions
+3 -2
View File
@@ -3424,9 +3424,10 @@ class TestEquityAutoClose(WithTmpDir, WithTradingCalendar, ZiplineTestCase):
frequency=frequency
)
path = self.tmpdir.getpath("testdaily.bcolz")
BcolzDailyBarWriter(path, dates, self.trading_calendar).write(
iteritems(trade_data_by_sid),
writer = BcolzDailyBarWriter(
path, self.trading_calendar, dates[0], dates[-1]
)
writer.write(iteritems(trade_data_by_sid))
reader = BcolzDailyBarReader(path)
data_portal = DataPortal(
env.asset_finder, self.trading_calendar,