Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

How to convert DSGRID in Excel to python?

I want to retrieve historical gross price and clean price for a certain bond.

The Excel query is:

=DSGRID("CA823901AK94","GP;CP","2016-05-31","2016-06-11","D","EDateCellRef=true;SDateCellRef=true;RowHeader=true;ColHeader=true;DispSeriesDescription=false;YearlyTSFormat=false;QuarterlyTSFormat=false","")

where CA823901AK94 is Bond ISIN.
I tried

ek.get_data('CA823901AK94',

fields = ['TR.CLEANPRICE.date','TR.CLEANPRICE','TR.DIRTYPRICE'],

parameters = {'SDate': '2016-05-31', 'EDate': '2016-06-11', 'FRQ': 'D'}),

but it returns NA

eikon-data-apibonds
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.

1 Answer

· Write an Answer
Upvote
Accepted
5.5k 21 2 6

Hi @junminhu ,


It looks like fields such as 'TR.CLEANPRICE.' don't exist for bonds such as 'CA823901AK94 ':

1648136481077.png

To find fields that exist for any one instrument, please use the Data Item Browser as per this video.


Please also consider having a look at bon-related pyhton code exampls in CodeBook, e.g.: in the folder '__Examples__/03. Quantitative Analytics/03.03. Bonds/EX_03_03_01__Function__Bond_Pricing.ipynb':


1648136691717.png


Does this answer your inquiry? If not, please don't hesitate to look into relevant articles such as:


Computing Risk Free Rates and Excess Returns Part 2

Payout Schedule & Cash Flow Analysis for a Bond Portfolio

Debt Structure Analysis on an Organizational Level


1648136481077.png (47.5 KiB)
1648136691717.png (87.2 KiB)
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.