CDS Index Time Series via Matlab & Phyton API
I am using Matlab and the Python API in order to retrieve time series of spreads for CDS indices. The corresponding line of code is:
[pylog,datarefinitiv]= evalc('py.eikon.get_timeseries(ric{iric},field,datestr(startdate,''yyyy-mm-dd''),datestr(enddate,''yyyy-mm-dd''))');
with:
ric = cell array with the relecant RICs; iric = counting integer
field = 'VALUE'
startdate and enddate (type datenum) to specify the period of interest
This works absolutely fine for several CDS indices (e.g. ITEEU5Y=MP, ITEXO5Y=MP, and CDXIG5Y=MP) and gives the daily Mid Spread Close values (as verified using the Excel API). However, for one of the indices, CDXHY5Y=MP, this retrieves the Mid Price Close values instead of spread data.
Could you please help how to specify the parameter field in order to obtain the Mid Spread Close values for the latter RIC?
Best Answer
-
Hi @Jirapongse,
thanks for your support!
For the sake of completeness of clarifying the issue, the following adaption to the mentioned code line solved the problem:
[pylog, datarefinitiv] = evalc("py.eikon.get_data('CDXHY5Y=MP', 'TR.MIDSPREAD.Date,TR.MIDSPREAD', struct('SDate', '2023-06-01', 'EDate', '2023-07-24', 'Frq', 'D'))");
0
Answers
-
Thank you for reaching out to us.
The ek.get_timeseries method can only retrieve the default timeseries view of each RIC. The default view of ITEEU5Y=MP is MID_SPREAD while the default view of CDXHY5Y=MP is MID_PRICE.
You can use the get_data method instead.
df, err = ek.get_data(["CDXHY5Y=MP"],
["TR.MIDPRICE","TR.MIDPRICE.Date"],
{"SDate":"2023-06-01","EDate":"2023-07-24","Frq":"D"})
dfOtherwise, you can use the Refinitiv Data Library for Python instead.
The examples are on GitHub.
0 -
Many thanks for your support and the clarification!
I haven't been aware of that property of the get_timeseries function.
I am now using the get_data function and succeeded in retrieving data from the desired field:
[pylog,datarefinitiv]= evalc('py.eikon.get_data(''CDXHY5Y=MP'',''TR.MIDSPREAD.Date,TR.MIDSPREAD'')');
Unfortunately, I cannot completely replicate your example (i.e. the specification of start and end time as well as daily frequency) when calling the Phython API from the Matlab environment.
- df, err = ek.get_data(["CDXHY5Y=MP"],
- ["TR.MIDPRICE","TR.MIDPRICE.Date"],
- {"SDate":"2023-06-01","EDate":"2023-07-24","Frq":"D"})
- df
Could you maybe also help how to adapt my code line in order to add these additional parameters?
0 -
We need to check how py.eikon.get_data works.
It should be a wrapper of Eikon Data API. You need to contact your developers regarding how to set the parameters in py.eikon.get_data.
0
Categories
- All Categories
- 6 AHS
- 39 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
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛