Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions alphacompiler/data/load_quandl_sf1.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@


def clear_raw_folder(raw_folder_path):
# check if raw exists, else create raw
raw_f_path = os.path.join(BASE, "raw")
if not os.path.exists(raw_f_path):
# If it doesn't exist, create the "raw" folder
os.makedirs(raw_f_path)
print(f"The 'raw' folder has been created at: {raw_f_path}")

# removes all the files in the raw folder
print(' ** clearing the raw/ folder **')
files = glob.glob(raw_folder_path + '/*')
Expand Down
6 changes: 4 additions & 2 deletions alphacompiler/util/zipline_data_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def get_tickers_from_bundle(bundle_name):
bundle_data = load(bundle_name, os.environ, None)

# get a list of all sids
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
#lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(country_codes=[str("US")]) # enable zipline-reloaded
all_sids = lifetimes.sid

# retreive all assets in the bundle
Expand All @@ -82,7 +83,8 @@ def get_all_assets_for_bundle(bundle_name):
bundle_data = load(bundle_name, os.environ, None)

# get a list of all sids
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
#lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(country_codes=[str("US")]) # enable zipline-reloaded
all_sids = lifetimes.sid

print('all_sids: ', all_sids)
Expand Down