scubamut
2/9/2019 - 1:44 PM

QUANDL DATA

import os
import pandas as pd
from pandas import Timestamp
from zipline.data.bundles import load
from zipline.data.bundles.quandl import quandl_bundle
from zipline.data.data_portal import DataPortal
# from zipline.utils.calendars import get_calendar
import pandas_market_calendars as mcal

now = Timestamp.utcnow()
bundle = load('quantopian-quandl', os.environ, now)

all_assets = bundle.asset_finder.retrieve_all(bundle.asset_finder.sids)
symbols = set(
str(asset.symbol) for asset in bundle.asset_finder.retrieve_all(bundle.asset_finder.equities_sids)
)
print(symbols)

quandl_data = DataPortal(asset_finder= bundle.asset_finder,
trading_calendar = mcal.get_calendar('NYSE'),
first_trading_day = bundle.equity_daily_bar_reader.first_trading_day,
equity_minute_reader=bundle.equity_minute_bar_reader,
equity_daily_reader=bundle.equity_daily_bar_reader,
adjustment_reader=bundle.adjustment_reader)

print(quandl_data)