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})
Best Answer
-
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'],
0
Answers
-
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"
0 -
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
df20 -
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
0 -
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
0 -
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.
0 -
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,
Gerald0 -
is there a way to filter for fields that are supported by the historical data retrieval
- I think you can select it on the DIB
and for fields that are retrievable by python API?
- All the fields you see in DIB is retrievable on Eikon Data API(Python) with the same value you see on DIB
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.
- You can raise a ticket to helpdesk at https://my.refinitiv.com/
And ask them to provide a sample on Eikon Excel using =TR function Do not use RHistory function because if the default view on an instrument is not the same as the view you use on Eikon Excel, then it is not retrievable using API.
This website is for technical question so usually when helpdesk see the "API" in the question, they usually redirect users to this website.
However, your questions are about content, not the API technical question.
0 -
Hi ,
I reached out the the helpdesk. This was the result they returned, they weren't able to get historical dates.
=TR("JPY1M=","DAYS_MAT;MID_PRICE","Frq=D SDate=2020-05-01 EDate=2020-05-30 CH=Fd")
Excel Result:
Python Result:
Why does python only produce one line item?
Regards,
Gerald0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛