Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 2 3

daily closing prices for fx rates via Python

Description:
Hi, I'm trying to get daily closing prices of bunch of fx rates via Python. However, it doesn't take the starting date and the end date correctly.

da='2015-10-01' a= '2017-12-31'
ccy=['EUR=','EURTRY=','EURAUD=','EURCAD=','EURCHF=','EURGBP=','EURHKD=','EURJPY=','EURKRW=R','EURRUB=','EURSGD=','EURCNY='] fx=ek.get_timeseries(ccy,fields=['CLOSE'], start_date =da, end_date = a, interval='daily')


I tried also to use another funciton but I don't know the correct field, can you please help me out?
fx2=ek.get_data(ccy ,["TR.BID.date","TR.BID"], {"Sdate":da,'EDate': a,})[0]

Thank you in advance

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
39.4k 77 11 27

Here's an alternative that doesn't require multiple requests.

da = '2015-10-01' 
a = '2017-12-31' 
ccy = ['EUR=','EURTRY=','EURAUD=','EURCAD=','EURCHF=',
       'EURGBP=','EURHKD=','EURJPY=','EURKRW=R',
       'EURRUB=','EURSGD=','EURCNY='] 
fx = ek.get_data(ccy,['TR.BIDPRICE.date', 'TR.BIDPRICE'],
                {'SDate':da, 'EDate':a})
To learn what fields you can use with this request use Formula Builder wizard in Excel or Data Item Browser app in Eikon as described in this tutorial.
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

thanks a lot! it's exactly what I was looking for

Upvotes
79.2k 251 52 74

@derivato

For get_timeseries, it is a limitation of this function.

Refer to this discussion thread, for the interday timeseries interval, it is limited to 3K rows for a single request. You may need to split it to multiple requests.

Moreover, please also refer to EIKON DATA API USAGE AND LIMITS GUIDELINE.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.