Understood how to bring constituents from a stock index, but a CDS INDEX constituent we cannot, exam
Understood how to bring constituents from a stock index, but a CDS INDEX constituent we cannot, example, we need constituents from 0#CDXHY5Y31C=MP, anyone knows how to do it?, we are using python.
0
Best Answer
-
Just as you would expand a stock index.
>>> df, err = ek.get_data('0#CDXHY5Y31C=MP',['CF_NAME'])
>>> df.count()
Instrument 90
CF_NAME 90
dtype: int64
>>> df.head(20)
Instrument CF_NAME
0 CDXHY5Y=MP CDXHY.35.5Y
1 MSPRDHEADER= HEADER RIC
2 ADTX5YUSAX=MP ADT SECURITY
3 AESC5YUSAX=MP AES CORP
4 AKST5YUSAX=MP AK STEEL CORP
5 GMAC5YUSAX=MP ALLY FINANCIAL
6 AMD5YUSAX=MP AMD
7 AMR5YUSAX=MP AMERICAN AIRLINE
8 AXLA5YUSAX=MP AMERICAN AXLE
9 AMKR5YUSAX=MP AMKOR TECHNOLOGY
10 ARAM5YUSAX=MP ARAMARK SERVICES
11 ASH5YUSAX=MP ASHLAND
12 POL5YUSAX=MP AVIENT
13 CARF5YUSAX=MP AVIS BUDGET GRP
14 AVP5YUSAX=MP AVON PRDCTS
15 BLL5YUSAX=MP BALL
16 BVF5YUSAX=MP BAUSCH HEALTH
17 BZH5YUSAX=MP BEAZER HOMES USA
18 BBD5YUSAX=MP BOMBARDIER
19 BYD5YUSSX=MP BOYD GAMING0
Answers
-
Thanks Gurpreet, I tried with many fields and never thought with just the name will work, great, thank you, now that I have the constituents how can I link the result to ask for historical data from each constituent?
0 -
You will have to use a loop of some sort to get timeseries data. For e.g.
df, err = ek.get_data('0#CDXHY5Y31C=MP',['CF_NAME'])
for instr in df['Instrument']:
# another eikon API call to get timeseries dataIf you are interested in just getting a single field at certain date, something like this would work too:
>>> df2, err = ek.get_data(df['Instrument'].tolist(), ['CF_NAME', 'TR.OPENPRICE(SDate=2021-03-01)'])
>>> df2
Instrument CF_NAME Open Price
0 CDXHY5Y=MP CDXHY.35.5Y <NA>
1 MSPRDHEADER= HEADER RIC <NA>
2 ADTX5YUSAX=MP ADT SECURITY 245.803
3 AESC5YUSAX=MP AES CORP 89.329
4 AKST5YUSAX=MP AK STEEL CORP 83.087
.. ... ... ...
85 CSAL5YUSAX=MP UNITI GROUP 392.035
86 UHSI5YUSAX=MP UNIVERSAL HEALTH 111.236
87 UVN5YUSAX=MP UNIVISION COMM 445.73
88 VSTG5YUSAX=MP VISTRA CORP 67.098
89 YUM5YUSAX=MP YUM! BRANDS 126.499
[90 rows x 3 columns]0 -
Free Toca Life World simulation game for phones https://modpree.com/toca-life-world/
0
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 中文论坛