You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ingest時出現ValueError: Failed to find any assets with country_code 'TW' that traded between 2023-05-05 00:00:00+00:00 and 2023-05-05 00:00:00+00:00. This probably means that your asset db is old or that it has incorrect country/exchange metadata.
#6
Closed
tej87681088 opened this issue
Sep 7, 2023
· 0 comments
# 參數start='2022-12-16'end='2023-08-30'bundle_name='tquant'#-----------------------------------------------------------------------importosimporttejapi# set tej_key and basetej_key=<apikey>api_base=<api_base>os.environ['TEJAPI_KEY'] =tej_keyos.environ['TEJAPI_BASE']=api_basetejapi.ApiConfig.api_key=tej_keytejapi.ApiConfig.api_base=api_basefromzipline.dataimportbundlesfromzipline.data.data_portalimportDataPortalfromzipline.pipeline.domainimportTW_EQUITIESimportpandasaspdbundle=bundles.load(bundle_name)
sessions=TW_EQUITIES.all_sessions()
start_idx, end_idx=sessions.slice_locs(start, end)
extra_rows=0# Number of extra rows to compute before `start_date`.# Extra rows are needed by terms like moving averages that require a# trailing window of data.lifetimes=bundle.asset_finder.lifetimes(
dates=sessions[start_idx-extra_rows : end_idx],
include_start_date=False,
country_codes=('TW',),
)
count_lifetimes=lifetimes.T.sum()
count_lifetimes_zero=count_lifetimes[count_lifetimes==0]
count_lifetimes_zero.index.min(), count_lifetimes_zero.index.max()
The text was updated successfully, but these errors were encountered:
tej87681088
changed the title
ValueError: Failed to find any assets with country_code 'TW' that traded between 2023-05-05 00:00:00+00:00 and 2023-05-05 00:00:00+00:00. This probably means that your asset db is old or that it has incorrect country/exchange metadata. (#76) · Issues · TQuant / Zipline_tquant · GitLab
ValueError: Failed to find any assets with country_code 'TW' that traded between 2023-05-05 00:00:00+00:00 and 2023-05-05 00:00:00+00:00. This probably means that your asset db is old or that it has incorrect country/exchange metadata.
Sep 7, 2023
Ricky05250525
changed the title
ValueError: Failed to find any assets with country_code 'TW' that traded between 2023-05-05 00:00:00+00:00 and 2023-05-05 00:00:00+00:00. This probably means that your asset db is old or that it has incorrect country/exchange metadata.
ingest時出現ValueError: Failed to find any assets with country_code 'TW' that traded between 2023-05-05 00:00:00+00:00 and 2023-05-05 00:00:00+00:00. This probably means that your asset db is old or that it has incorrect country/exchange metadata.
Apr 17, 2024
原因
在run_pipeline的start及end期間內bundle至少要一家公司存在。可能是公司未上市,或bundle中沒該段時間的資料。
例如:
!zipline bundle-info
語法可得知下圖資訊:run_pipeline()
或run_algorithm()
的end_date設定為'2023-08-30',則會拋出以下錯誤:解法
run_pipeline()
或run_algorithm()
的start_date或end_dateos.environ['mdate']
os.environ['ticker']
$ zipline update
語法更新bundle。檢查程式
The text was updated successfully, but these errors were encountered: