本文整理汇总了Python中zipline.assets.AssetFinder.retrieve_all方法的典型用法代码示例。如果您正苦于以下问题:Python AssetFinder.retrieve_all方法的具体用法?Python AssetFinder.retrieve_all怎么用?Python AssetFinder.retrieve_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zipline.assets.AssetFinder
的用法示例。
在下文中一共展示了AssetFinder.retrieve_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: engine_from_files
# 需要导入模块: from zipline.assets import AssetFinder [as 别名]
# 或者: from zipline.assets.AssetFinder import retrieve_all [as 别名]
def engine_from_files(daily_bar_path,
adjustments_path,
asset_db_path,
calendar,
warmup_assets=False):
"""
Construct a SimplePipelineEngine from local filesystem resources.
Parameters
----------
daily_bar_path : str
Path to pass to `BcolzDailyBarReader`.
adjustments_path : str
Path to pass to SQLiteAdjustmentReader.
asset_db_path : str
Path to pass to `AssetFinder`.
calendar : pd.DatetimeIndex
Calendar to use for the loader.
warmup_assets : bool, optional
Whether or not to populate AssetFinder caches. This can speed up
initial latency on subsequent pipeline runs, at the cost of extra
memory consumption. Default is False
"""
loader = USEquityPricingLoader.from_files(daily_bar_path, adjustments_path)
asset_finder = AssetFinder(asset_db_path)
if warmup_assets:
results = asset_finder.retrieve_all(asset_finder.sids)
print("Warmed up %d assets." % len(results))
return SimplePipelineEngine(
lambda _: loader,
calendar,
asset_finder,
)