Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by gchiam · Jun 08, 2020 at 03:12 AM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikonswapsmaturity

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})


People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit-jintamalit · Jun 22, 2020 at 05:53 AM

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)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by pimchaya.wongrukun01 · Jun 08, 2020 at 04:09 AM

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"

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by chavalit-jintamalit · Jun 08, 2020 at 04:24 AM

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)
Comment

People who like this

0 Show 6 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
gchiam · Jun 08, 2020 at 05:35 AM 0
Share

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




avatar image
gchiam · Jun 08, 2020 at 05:42 AM 0
Share

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

avatar image
REFINITIV
chavalit-jintamalit ♦♦ gchiam · Jun 08, 2020 at 11:37 AM 0
Share

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.

avatar image
gchiam chavalit-jintamalit ♦♦ · Jun 09, 2020 at 01:04 AM 0
Share

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

How to get all investors for a list of stocks, historically with the python API

What other parameters can be used with the statement pertaining to Corporate Actions data such as Stock Splits?

Trying to fetch Close Bid Price for CMO tranche from Python

Retrieve Commodity Flows data using Python API

How can I get the EURIBOR 6M forward curve through the python API? Interest rate swap valuation.

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges