question

Upvotes
Accepted
3 3 3 0

Python RDP get_historical_price_summaries

hi, i noticed there is no error msg returned for get_historical_price_summaries, but instead a "None" is returned even you input an invalid ric. is there a way to turn on the error msg?

example:

df = rdp.get_historical_price_summaries('XXX.XX', interval=rdp.Intervals.DAILY, start='2020.11.01', end='2020.11.06')

also what is the data limit for get_historical_price_summaries, looks it works for a short lookback windows, but not even more than a year. i.e., "None" is return when more than a year.

df = rdp.get_historical_price_summaries('IBM.N', interval=rdp.Intervals.DAILY, start='2019.11.01', end='2020.11.06')

pythonrdp-apirefinitiv-data-platformrefinitiv-data-platform-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.

Upvotes
Accepted
7.6k 15 6 9

@jian.lu

Not sure what version of python and RDP Lib for python you are using? I found a similar issue sometime when using 1.0.0.6a with python 3.7. I have to check if the df is not None before process it. It randomly occurs even I use a short period or set count to a minimal value.

But I just reconfigure conda env using python 3.8 with rdp 1.0.0.7a and it seems to works fine for me now.

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.9k 80 39 63

Hi @jian.lu,

The RDP Libraries have multiple layers to request for data, the lowest layer being the delivery, on top of that we have the content layer and for scripting languages such as Python we have the function layer. The code segment you provided is at the function layer providing simple syntax returning data. At this layer, if you encounter situations where no data is returned, you can use some convenient functions to check.

For example,

rdp.get_last_status()

At the content layer, you have more control over the response. For example:

While the syntax to request for data is similar, the response contains some more information about the response.


ahs.png (8.8 KiB)
ahs.png (16.4 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.