New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
0 0 3 8

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?

eikon-data-apipythonrefinitiv-dataplatform-eikon#technologyrefinitiv-data-platform
icon clock
10 |1500

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

Upvotes
Accepted
7.5k 18 2 8

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"])

screenshot-2024-10-29-at-132303.png

So, the orgids from here can be used in the search query I have above.


Best regards,

Haykaz


icon clock
10 |1500

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

Upvote
7.5k 18 2 8

Hi @dianne.palmario ,


To list all the constituents you can use the following code:

constituents = rd.get_data("0#.GDAXHI", 'TR.OrgidCode')
constituents 

screenshot-2024-10-25-at-100128.png

As 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"
)


screenshot-2024-10-25-at-100241.png

Hope this helps.


Best regards,

Haykaz



icon clock
10 |1500

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

Upvotes
1 0 0 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? "

icon clock
10 |1500

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

Upvotes
7.5k 18 2 8

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:

screenshot-2024-10-28-at-101820.png


Hope this helps.


Best regards,

Haykaz


icon clock
10 |1500

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

Upvotes
1 0 0 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.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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