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
1 0 1 1

fx swap maturity

Hi,

I'm trying to get historical data for fx swaps in jupyter notebook (date, close , days_maturity). ek.get_timeseries only seems to show OHLC and volume.

I'm not quite sure on how to use the ek.get_date.

sd = "2020-06-01"

ed = "2020-06-05"

df,err= ek.get_data(["JPY1M=","JPY2M="],

['CF_DATE','CF_Last',"DAYS_MAT"],

{"SDate":sd, "Edate":ed})


eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiswapsmaturity
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
Accepted
18.2k 21 13 21

Hi @gchiam

I am not Eikon Excel expert, but I can confirm that the "DAYS_MAT" and "MID_PRICE" fields that are exposed to Eikon Data API(Python) do not support timeseries.


However, I found these fields (I was hoping that Refinitiv Content Helpdesk would be able to give you these fields)

['TR.MIDPRICE.Date','TR.MIDPRICE','TR.DAYSTOMATURITY.Date','TR.DAYSTOMATURITY'],


ahs.png (100.4 KiB)
ahs2.png (17.3 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
9.6k 10 7 7

Hello @gchiam

To use get_data() function, you can refer to "Data Item Browser" which lists all fields and their parameters that you can set in this function.

Please refer to Using DIB as Reference section in this tutorial for more details of "Data Item Browser"

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
18.2k 21 13 21

Hi @gchiam

These fields (['CF_DATE','CF_Last',"DAYS_MAT"], ) are from a Realtime database, so they do not support SDate, EDate, and historical data retrieval.

I tried to locate the close, date, and days_maturity using "Data Item Browser" but I could not locate them. (I am not a content expert)

You can try using "Data Item Browser" following this tutorial.

Or you can contact Refinitiv Content Helpdesk to clarify if there are any fields carrying the information you are looking for.


I do have a quick question here.

From the data you can retrieve:

Can you calculate the data you need following this code:


df1,e = ek.get_data('JPY1M=','MATUR_DATE')
df1

df2 = ek.get_timeseries('JPY1M=', fields='Close', start_date='2020-06-01', end_date='2020-06-05')
df2

import datetime

date_time_obj = datetime.datetime.strptime(df1['MATUR_DATE'][0], '%Y-%m-%d')
date_time_obj

df2['days_maturity'] = date_time_obj- df2.index
df2

ahs1.png (23.1 KiB)
ahs2.png (24.3 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.

Hi,

Thanks for the reply. I looked through the examples shown on the tutorial, it doesn't touch on FX swaps, and hence am not too sure about the DIB or the correct formatting. The problem with subtracting from df1 index is that the maturity dates are incorrect.

Df1 shows you today's 1m FX Swap maturity date. A 1June 1m FX swap will not have the same maturity date as the 8th june swap. Hence subtracting 8-jun fx swap from the historical data will not reflect the actual days to maturity. As shown in the df2 where days to maturity increase by 1 day each timestamp. When days to maturity should actually stay approx 30 days.

Regards,

Gerald




HI

Did this in excel using the function builder. Not excatly sure what NDA_RAW means. But seems to be the excel solution.

=RHistory("JPY1M=","NDA_RAW.Nda_date;NDA_RAW.Nda_days_maturity;NDA_RAW.Nda_mid","INTERVAL:1D",,"CH:Fd",D29)

But I can't find this fields in python using get_data ()

Regards,

Gerald

Hi @gchiam

Excel - RHistory can select data views (In this case you are selecting NDA_RAW view).

Eikon Data API(Python) - cannot select view, it is only able to retrieve default views. (default view depends on individual item)


Df1 shows you today's 1m FX Swap maturity date. A 1June 1m FX swap will not have the same maturity date as the 8th june swap. Hence subtracting 8-jun fx swap from the historical data will not reflect the actual days to maturity. As shown in the df2 where days to maturity increase by 1 day each timestamp. When days to maturity should actually stay approx 30 days.

I am sorry, that means my assumption of the maturity date - date = days in maturity is incorrect. (I am not a content expert)

In this case, you should contact Refinitiv Content Helpdesk to confirm if there is any fields carrying historical information which should be available on "Data Item Browser" (note that NDA_RAW view from RHistory is not retrievable with Eikon Data API Python)

"Data Item Browser" is just a tool which you can use it to explore any available fields base on individual instrument.

Hi,

On the data item browser, is there a way to filter for fields that are supported by the historical data retrieval (more specifically, prices and maturity dates), and for fields that are retrievable by python API?

How should i contact the refinitiv content helpdesk? I reached out to the thomson reuters live agent and they directed me to post my questions on this site.

Regards,
Gerald

Show more comments

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.