How to get all bonds issued by companies in an index, e.g. 0#.GDAXHI using python?

How to get all bonds issued by companies in an index, e.g. 0#.GDAXHI using python?
Is there a way we can list down all constituent RICs under 0#.GDAXHI, then use the result in rd.discovery.search > rd.discovery.Views.GOV_CORP_INSTRUMENTS to retrieve all the bonds issued?
Answers
-
Hi @dianne.palmario ,
To list all the constituents you can use the following code:
constituents = rd.get_data("0#.GDAXHI", 'TR.OrgidCode')
constituentsAs you probably noticed I have additionally requested Issuer OrgID which is going to be used under search:
issuer_org_ids = ' '.join(f"'{org_id}'" for org_id in constituents['ORG ID'])
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = f"(DbType eq 'CORP' and IsActive eq true and IssuerOrgid in ({issuer_org_ids}))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf,IssuerOrgid"
)Hope this helps.
Best regards,
Haykaz
0 -
@aramyan.h thank you for your response. Can you please assist with client follow up below:
"Can you modify the query such that I download bonds issued by the HDAX100 constituents and their subsidiaries? Additionally, I am only interested in Corporate Bonds (Notes, Bonds, Bills) issued from 2013 until 2024. Can you add these features into the code? "
0 -
Hi @John.Cajayon ,
I am not sure we have an api query to get subsidiaries. Where do you see that info on Workspace? if you direct me to that, I may be able to find something. Alternatively, if you know the orgids of those subsidiaries, it can be added into issuer_org_ids variable.
As for the dates, you can use the following modified search request:
issuer_org_ids = ' '.join(f"'{org_id}'" for org_id in constituents['ORG ID'])
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = f"(DbType eq 'CORP' and IsActive eq true and (IssuerOrgid in ({issuer_org_ids})) and (IssueDate ge 2013-01-01 and IssueDate le 2024-01-01))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf,IssuerOrgid"
)Additionally for building search queries you can use the Advanced Search app in Worksppace, build your query and Export the code as shown below:
Hope this helps.
Best regards,
Haykaz
0 -
Hello @aramyan.h
To retrieve the Level - 1 subsidiaries (along with Joint Ventures and Affiliates), we have these data items:TR.ImmediateParent
TR.RelatedOrgId
TR.RelatedOrgName
TR.RelatedOrgType
TR.RelatedOwnPct
TR.RelatedOrgISO2
TR.RelatedOrgCountry
Here is a sample formula in Excel:
=@RDP.Data("ENGP.WA","TR.RelatedOrgId;TR.RelatedOrgName;TR.RelatedOrgType;TR.RelatedOwnPct;TR.RelatedOrgISO2;TR.RelatedOrgCountry","CH=Fd RH=IN",B2)
Here is a related article on how to get the parent company and subsidiary in Workspace.
This information can also be accessed via the TREE App on LSEG Workspace desktop.
0 -
Hi @John.Cajayon ,
Thanks for sharing this. The equivalent code for RD Libraries is going to be the following:
rd.get_data("ENGP.WA",fields = ["TR.RelatedOrgId", "TR.RelatedOrgName", "TR.RelatedOrgType", "TR.RelatedOwnPct", "TR.RelatedOrgISO2", "TR.RelatedOrgCountry"])
So, the orgids from here can be used in the search query I have above.
Best regards,
Haykaz
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛