mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-09 11:19:23 +08:00
Changed default bundle to poloniex and new crypto examples
This commit is contained in:
@@ -99,7 +99,7 @@ def poloniex_cryptoassets(symbols, start=None, end=None):
|
||||
df['date']=pd.to_datetime(df['date'], utc=True, unit='s')
|
||||
df.set_index('date', inplace=True)
|
||||
|
||||
df = df.resample('D').mean()
|
||||
#df = df.resample('D').mean()
|
||||
df = df.loc[df.index.isin(calendar.schedule.index)]
|
||||
|
||||
# the start date is the date of the first trade and
|
||||
|
||||
@@ -407,39 +407,3 @@ def quantopian_quandl_bundle(environ,
|
||||
|
||||
|
||||
register_calendar_alias("QUANDL", "NYSE")
|
||||
|
||||
CATALYST_URL = (
|
||||
'https://s3.amazonaws.com/quantopian-public-zipline-data/quandl'
|
||||
)
|
||||
|
||||
|
||||
@bundles.register(
|
||||
'catalyst',
|
||||
calendar_name='NYSE',
|
||||
minutes_per_day=390,
|
||||
create_writers=False,
|
||||
)
|
||||
def catalyst_bundle(environ,
|
||||
asset_db_writer,
|
||||
minute_bar_writer,
|
||||
daily_bar_writer,
|
||||
adjustment_writer,
|
||||
calendar,
|
||||
start_session,
|
||||
end_session,
|
||||
cache,
|
||||
show_progress,
|
||||
output_dir):
|
||||
if show_progress:
|
||||
data = download_with_progress(
|
||||
CATALYST_URL,
|
||||
chunk_size=ONE_MEGABYTE,
|
||||
label="Downloading Bundle: catalyst",
|
||||
)
|
||||
else:
|
||||
data = download_without_progress(CATALYST_URL)
|
||||
|
||||
with tarfile.open('r', fileobj=data) as tar:
|
||||
if show_progress:
|
||||
print("Writing data to %s." % output_dir)
|
||||
tar.extractall(output_dir)
|
||||
|
||||
Reference in New Issue
Block a user