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 do I get Clean Price for US treasuries

I am trying the following, but it is not finding the field and fills the dataframe with <NA>s


df = ek.get_timeseries(

'US5YT=RR',

fields = ['TR.CLEANPRICE']

)


display(df)


eikon-data-apidatahistoricalbondstimeseries
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

Upvotes
Accepted
8k 15 5 8

Hi @Rana.Mallah ,

I'd like to add that to get the historical data of clean price, the parameters of start date (SDate) and end date (EDate) can be added into the get_data function, please find an example code below

  • 0D mean Last Trading Day and -10D mean 10 day before that
  • or you can use the absolute date on SDate and EDate as well, For example,
                      
    1. parameters={ 'SDate':'2021-09-01', 'EDate':'2021-09-20'}
df, err = ek.get_data('US5YT=RR', fields = ['TR.CLEANPRICE.date', 'TR.CLEANPRICE']
                      , parameters = {'SDate':'-10D', 'EDate':'0D'})
df

1639564932787.png



1639564932787.png (24.0 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.