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

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-apiworkspacerefinitiv-dataplatform-eikonworkspace-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.

Upvotes
Accepted
18.7k 85 39 63

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 512.0 KiB each and 1.0 MiB total.

Upvotes
10.6k 20 6 9

@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 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.