question

Upvotes
Accepted
9 1 0 1

Is there a way to get full historical data of an instrument using RDP Python API?

Below is my code to retrieve an example bond data using RDP Python API:


import refinitiv.data as rd

from refinitiv.data.content import historical_pricing

rd.open_session('desktop.workspace')

response = historical_pricing.summaries.Definition(

universe='TH179175215=',

fields=['ZSPREAD'],

start='2010-04-20',

end='2024-06-03',

).get_data()

response.data.df

Currently, I am arbitrarily defining an early date (2010-04-20) to get the full history of the bond data. However, I would like to ask if there is a value I can put for the start parameter to get the full historical data? Something like 'BDATE' in the Datastream Python API. Thanks!

workspace#technologypython apirefinitiv-data-libraries
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
Upvotes
Accepted
81.2k 266 53 76

@feldman.lee

Thank you for reaching out to us.

You may use another function to get the date. For example, I found that the TH179175215= provide the TR.FirstAnnounceDate field.

rd.get_data(["TH179175215="],["TR.FirstAnnounceDate"])

The output is:

1718600484753.png

You can use the Data Item Browswer tool to search for other fields. However, you can contact the helpdesk support team my Refinitiv to confirm that this is the corrrect date field.

Otherwise, if you don't specify the start parameter, it will return the EarliestAvailable but you need to specify the count parameter.

response = historical_pricing.summaries.Definition(
 universe='TH179175215=',
 fields=['ZSPREAD'],
 end='2024-06-03',
 count=10000
).get_data()


response.data.df

1718600484753.png (3.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.

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.