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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 2

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 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 5.0 MiB each and 10.0 MiB total.

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

Upvotes
38.1k 71 35 53

@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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea