ek.get_timeseriesで複数銘柄のデータ取得における、取得期間不足の問題

pythonにおいて、下記プログラムで日経225の構成銘柄のデータを期間2017-01-01 ~ 2021-02-18で同時に取得した所、期間2017-01-01 ~ 2021-02-01のデータが取得できませんでした。
この原因はなんでしょうか? また、どのように改善を行えばよろしいでしょうか?
app = ''
import eikon as ek
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
ek.set_app_key(app)
target_data_code = ek.get_data(['0#' + '.N225'],fields = 'DSPLY_NMLL')
code = list(target_data_code[0]["Instrument"]); code.sort()
data=ek.get_timeseries(code,start_date = '2017-01-01', end_date = '2021-02-18')
Best Answer
-
hello @tomoya.suzuki.lab
There's a limit of the Eikon Data API, for more detail, please check Eikon Data API Usage and Limits Guideline. This case is about "Call-based Limits"
Datapoints returned per request - A datapoint is a 'cell', or a unique field value for a unique instrument on a unique time stamp. Datapoint limits vary by the content set being retrieved (for example, timeseries limits are different from news headline limits), but all are throttled on a per request basis and are not aggregated across all applications. Here are Datapoint limit examples per Eikon Data API function type
get_timeseries: The current limit value (10-Oct-2019) is 3,000 data points (rows) for interday intervals and 50,000 data points for intraday intervals. This limit applies to the whole request, whatever the number of requested instrument.
the length of the list "code" from your code is 225 RICs, and there're 13 rows of the date in the output (mean there's 225 * 13 = 2925 rows returned)
To get the data of all the dates, you may loop the request and merge the output datasets together later. Each loop can either loop through the RIC list or date list.
For example, to loop through the RIC list,
- get the maximum number of RIC that can be called in a request 3000, divided by the number of dates you'd like to request the data
- for 2017-01-01 and 2021-02-18, there are 1510 dates
- 3000/1510 = 1 so only 1 RIC can be called per the request
- below is an example code to get data and merge the output data frames of the first 3 RICs
df = ek.get_timeseries(code[0],start_date = '2017-01-01', end_date = '2021-02-18')
df = df.add_prefix(f'{code[0]}_')
for _ in code[1:3]:
df_temp = ek.get_timeseries(_,start_date = '2017-01-01', end_date = '2021-02-18')
df_temp = df_temp.add_prefix(f'{_}_')
df = df.merge(df_temp, how='outer', on='Date')
display(df)- an output qna-002.png
Hope this could help
0 - get the maximum number of RIC that can be called in a request 3000, divided by the number of dates you'd like to request the data
Answers
-
ご回答ありがとうございました。
参考にさせていただきます。0 -
Hello @tomoya.suzuki.lab and all,
Per Google translate "Thank you for your answer. I am going to use it as an example." I am marking answer by @raksina.samasiri as correct in answering the question.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.8K Refinitiv Data Platform
- 625 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛