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
16 5 7 10

Retrieve EOD bond price Python eikon

Hi, I want to be able to retrieve the EOD dirty prices of corporate bonds (international portfolio) using Python eikon API (see code snippet below).

How can I do that?

Can someone also pls explain:

a) can I use this Sdate argument and how? What does Sdate="0D" or "-1D" mean?

b) does 'TR.CLEANPRICE.date' give me the date on which the bond last traded or .. ?

c) what is the difference between 'TR.DIRTYPRICE' and "DIRTY_PRC" ?


Many thanks in advance.


****************************************************************

lst = ["902613AH1="]

databnd, err = ek.get_data(lst,fields = ['TR.FIAccruedInterest',

'TR.FiNumberAccruedDays',

'TR.CLEANPRICE',

'TR.CLEANPRICE.date',

'TR.DIRTYPRICE',

'DIRTY_PRC']

, parameters = {"Sdate":'-1D'})

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

@grigorios.mamalis

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Upvote
Accepted
14.2k 30 5 10

hello @grigorios.mamalis ,

The Data Item Browser could give you the description and some detail you'd like to know, to access it, search for DIB in the Eikon Desktop search box.

Anyway, please see the answers to your questions below

a) can I use this Sdate argument and how? What does Sdate="0D" or "-1D" mean?

  • Yes, you can use the SDate to specify the beginning of the data period,
    • 0D mean Last Trading Day and -1D mean 1 day before that
    • or you can use the absolute date on SDate and EDate as well, For example,
      parameters={'SDate':'2021-09-01', 'EDate':'2021-09-20'}
    • To see which field has SDate parameter available, you can check in DIB > search the instrument (RIC) you're interested > search for the field > on the right panel, there's the Description and Parameters tabs, click on Parameters to see which one is available for the field, this also contains the description of 0D, 1D

b) does 'TR.CLEANPRICE.date' give me the date on which the bond last traded or .. ?

c) what is the difference between 'TR.DIRTYPRICE' and "DIRTY_PRC" ?

  • For questions b) and c), as this forum is primarily for API / programming-type questions - most of the forum moderators are not Content experts. So, please raise a Content query in MyRefinitiv helpdesk, which you can have direct communication with the content expert. Select 'I need help using product' and product: 'Refinitiv Eikon'.
  • speaking of which, I've raised the inquiry regarding the content on case number 10434923, the content expert will give you information about this soon.
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
10.2k 18 6 9

@grigorios.mamalis I will try to address so of your points:

lst = ["902613AH1="]

databnd, err = ek.get_data(lst,fields = ['TR.ACCRUEDINTEREST.date','TR.ACCRUEDINTEREST','TR.FiNumberAccruedDays','TR.CLEANPRICE.date','TR.CLEANPRICE.calcdate','TR.CLEANPRICE','TR.DIRTYPRICE'],parameters = {"Sdate":'-100D', "EDate":'0D', 'Frq':'D'})

databnd

So you have a mixture of fields which have interday timeseries available eg Clean Price / Dirty Price and Accrued Interest and also a field which is a static field eg umber of Accrued Days. You can use the Data Item Browser app (type DIB into eikon search to launch) to identify which fields have timeseries available or not. I would keep timeseries requests in one API call and static requests in another API call.

a) SDate argument can be either absolute eg '2021-09-01' or relative eg '-10D' Start Date there is accompanying EDate parameter and usually we put in an Frq 'D' parameter (default is D, could be W, M, Y etc. More information is available in reference guide.

b) I am not a content expert but we have a number of toggleable output types (you can see these in the DIB parameters), .calcdate is usually the date of the calculation. I have included both.

c) TR.DIRTYPRICE is a collected field which provides an interday timeseries history - DIRTY_PRC is a realtime streaming intraday field which does not provide any timeseries history. The TR.DIRTYPRICE for the day will be the last value but in parameters you have options to choose from CLOSE, LAST, HIGH, LOW etc.

I hope this can help.

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
16 5 7 10

Many thanks to both of you for your feedback.

Grigorios

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.