diff --git a/zipline/pipeline/loaders/equity_pricing_loader.py b/zipline/pipeline/loaders/equity_pricing_loader.py index 8d00f602..6494e977 100644 --- a/zipline/pipeline/loaders/equity_pricing_loader.py +++ b/zipline/pipeline/loaders/equity_pricing_loader.py @@ -16,6 +16,10 @@ from numpy import ( uint32, ) +from zipline.data.us_equity_pricing import ( + BcolzDailyBarReader, + SQLiteAdjustmentReader, +) from zipline.lib.adjusted_array import ( adjusted_array, ) @@ -40,6 +44,24 @@ class USEquityPricingLoader(PipelineLoader): self._calendar = self.raw_price_loader._calendar self.adjustments_loader = adjustments_loader + @classmethod + def from_files(cls, pricing_path, adjustments_path): + """ + Create a loader from a bcolz equity pricing dir and a SQLite + adjustments path. + + Parameters + ---------- + pricing_path : str + Path to a bcolz directory written by a BcolzDailyBarWriter. + adjusments_path : str + Path to an adjusments db written by a SQLiteAdjustmentWriter. + """ + return cls( + BcolzDailyBarReader(pricing_path), + SQLiteAdjustmentReader(adjustments_path) + ) + def load_adjusted_array(self, columns, dates, assets, mask): # load_adjusted_array is called with dates on which the user's algo # will be shown data, which means we need to return the data that would