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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

API Call for Treasury Price not Yield

When I make a call in Python such as the one below, I get OHLC quoted in yields:

df = ek.get_timeseries('AU3YT=RR', start_date = '2000-01-01', end_date = '2021-04-20')

However, in excel I can do a similar call, but get the price (and the yield if I want):

=@RHistory("AU3YT=RR","ASK.Timestamp;ASK.Close","INTERVAL:1D",,"TSREPEAT:NO CH:Fd",D4)

Is there a way to edit my python call to get bond price instead of yield?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonbonds
icon clock
10 |1500

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

Upvotes
Accepted
9.7k 49 38 60

Hi @michael01,

I would suggest you use the DIB (Data Item Browser) within the desktop to help you hunt down the specific fields you need. Once done, you can use the following get_data() call, for example:

df, err = ek.get_data('AU3YT=RR', ['TR.ASKPRICE', 'TR.ASKPRICE.date'], 
                      parameters = {'SDate': 0,'EDate': -10,'Frq': 'D'})
df


1619629314598.png (79.1 KiB)
icon clock
10 |1500

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

Upvotes
6.7k 8 6 7

@michael01 Please try the following:

df,err = ek.get_data('AU3YT=RR',['TR.AskPrice.date','TR.AskPrice'],{'SDate':'2000-01-01','EDate':'2021-04-20','Frq':'D'})

df

I hope this can help.


1619628980710.png (122.1 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea