Historical 1 minute interval data between 15:30 – 17:30 CET for the last 90 days
Hi Team,
Can you advise what script can we use in Python Eikon API to get the Historical 1 minute interval data between 15:30 – 17:30 CET for the last 90 days.
Sample RICs
Best Answer
-
Hi @dianne.palmario and @kenley.macandog123,
Here's the code
import eikon as ek
import pandas as pd
import datetime
ek.set_app_key('####YOUR_APP_KEY####')
rics = ['ADSGn.DE','AIRG.DE','ALVG.DE','BASFn.DE','BMWG.DE']
df_list = []
today = datetime.datetime.today()
start_date = today - datetime.timedelta(90)
# looping to get the data of 30 days in each call
while start_date < today:
end_date = start_date + datetime.timedelta(days=30)
df = ek.get_timeseries(rics, start_date=start_date, end_date=end_date,interval='minute')
df_list.append(df)
start_date = end_date + datetime.timedelta(days=1)
result = pd.concat(df_list)
#display(result)
# filter the time interval
df_duration = result.iloc[(result.index.time >= datetime.time(14, 30))&(result.index.time <= datetime.time(16, 30))]
display(df_duration)Hope this helps and please let me know in case you have any further questions.
1
Answers
-
Hi @kenley.macandog123 ,
Is this what you're looking for?
First, to get the Historical 1-minute interval data in the last 90 days. However, as there's a limit of an API call in Eikon, so please check this Eikon Data API Usage and Limits Guideline and adjust the start_date, and end_date to not exceed the Eikon Limits.
import eikon as ek
import datetime
from datetime import time
ek.set_app_key('####YOUR_APP_KEY####')
df = ek.get_timeseries(['ADSGn.DE','AIRG.DE','ALVG.DE','BASFn.DE','BMWG.DE'],
start_date=datetime.timedelta(-90),
end_date=datetime.timedelta(0),
interval='minute')
display(df)Then after you get the data of the last 90 days, you can filter only the time you're interested, to confirm the timezone of data returned, you may check with the Content team by raising the ticket via MyRefinitiv.
Hope this helps and please let me know in case you have any further questions.
0 -
Hello, I need to get data between 14:30 to 16:30 GMT Daily.
This works:
df1 = df.iloc[df.index.time >= datetime.time(14, 30)]
But this one does not:
df1 = df.iloc[df.index.time >= datetime.time(14, 30), df.index.time <= datetime.time(16, 30)]
Please advise. Thank you.
1 -
Hi @kenley.macandog123 and @dianne.palmario ,
as mentioned in this thread that
get_timeseries method of Eikon Data APIs library always returns timestamps in GMT.
You may find another way to do the time conversion, in this case, I'm using the time range you used
df1 = df.iloc[(df.index.time >= datetime.time(14, 30))&(df.index.time <= datetime.time(16, 30))]
display(df1)However, as the data returned is less than latest 90 days due to the Eikon API call limit, you need to call a get_timeseries function in loops with the parts of latest 90 days and then merge the data together.
Hope this helps and please let me know in case you have any further questions.
0 -
Can you please provide a script that calls a get_timeseries function in loops with the parts of latest 90 days? Like how the script would look like so that we can see more than the latest 90 days limitation?
0 -
Hi Raksina,
thx a lot for the script, a nice way to solve the problem.
I appreciate it a lot.
Regards,
Silvio
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛