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

Download Swap Zero Curve with Rstudio

Hi,

I'm trying to download with Rstudio through Api the Swap Zero Curve for Euribor1M with all tenors available in one day, but I can't get any value. Can someone help me to solve the error?.

curve <- get_timeseries('0#EURAMMEZ=R',"CLOSE","2020-06-16T00:00:00","2020-06-16T00:00:00","daily")

Thanks

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apizero-curve
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
10.1k 18 6 9

Hi @eva_maria.vela.palomino thanks for your question - the issue here is that the get_timeseries function does not decode chain RICs. In this instance you would need to use a get_data function to retrieve the list of instruments in the chain:

data_frame = get_data("0#EURAMMEZ=R", "CF_Name"))

That will give you a list of instruments that you can then get the timeseries history for. Alternatively as you seem to only want a snapshot of todays curve - you could use the get_data call to do this in one pass as the get_data call can decode chains.

data_frame = get_data("0#EURAMMEZ=R",list( "CF_Name","CF_Last"))

... (this output is from python but its the same in R)

I hope this can help.


1592398747145.png (121.9 KiB)
1592398861941.png (108.8 KiB)
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.

Upvotes

jason.ramchandani Thank you very much for your answer, it's just what I needed. If I want to download this same information but for a specific day, for example 28/02/2019, how should I indicate the date?.

This doesn't work for me:

data_frame <- get_data("0#EURAMMEZ=R",list( "CF_Name","CF_Last"),parameters = {'SDate':'2019-02-28','EDate':'2019-02-28'})

Where can I get a list to know the name of the field in order to add the discount factor curve of this curve to the download list?

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
10.1k 18 6 9

Hi @eva_maria.vela.palomino - so as these are realtime fields - we cant get the history from get_data. The only way to get a history is to use the get_timeseries function - I have just put the first 2 instruments in here but you should be able to take the chain output and turn that into a list with a bit of manipulation ie ignore first 3 rows etc.

curve =get_timeseries(list("EURAMMEONZ=R","EURAMMETNZ=R"),fields=list("CLOSE"),start_date = "2020-02-03T00:00:00",end_date = "2020-02-03T23:59:00",interval="daily",debug=TRUE)

You can use the Data Item Browser app (type DIB into search bar) to check fields and values for any instrument we carry. In terms of the specific discount factor for the curve you are looking for - you would need to contact the content helpdesk for help there.

I hope this is of use.


1592469155616.png (13.9 KiB)
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.

This option does not work. I get the following error:

Error in 1: nrow (input_data_frame): argument of length 0

curve <- get_timeseries(list("EURAMMEONZ=R","EURAMMETNZ=R","EURAMME1WZ=R","EURAMME1MZ=R"),'CLOSE','2020-02-28','2020-02-28','daily')


I have also tried this other alternative

RIC <- list("EURAMMEONZ=R","EURAMMETNZ=R","EURAMME1WZ=R","EURAMME1MZ=R","EURAMME2MZ=R","EURAMME3MZ=R","EURAMME6MZ=R","EURAMME9MZ=R","EURAMME1YZ=R","EURAMME1Y3MZ=R","EURAMME1Y6MZ=R","EURAMME1Y9MZ=R","EURAMME2YZ=R","EURAMME2Y3MZ=R","EURAMME2Y6MZ=R","EURAMME2Y9MZ=R","EURAMME3YZ=R","EURAMME3Y3MZ=R","EURAMME3Y6MZ=R","EURAMME3Y9MZ=R"....... )

curve <- get_timeseries(RIC,'CLOSE','2020-02-28','2020-02-28','daily')

@eva_maria.vela.palomino my bad - you need to add timestamps to get_timeseries dates in R (you don't in Python) I have altered the sample code to reflect this.

Upvotes
10.1k 18 6 9

Hi @eva_maria.vela.palomino I have updated the code in R you need to provide timestamps for dates in get_timeseries.

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.

Hi jason ramchandani ,

the field for downloading the discount curve into an excel file is 'DISC_FACTR.Value' and for the maturity date it is 'MATUR_DATE'. I have searched the application as you indicated me, to see the fields available for this RIC. I have tried with the DISC_RATE option but i get NAN value.

capture.png (82.0 KiB)

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.