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
3 0 0 2

Unable to Retrieve 1-Minute Historical Bid and Ask Size using Refinitiv's Python SDK

Hello,

I am trying to access historical bid and ask size data for the instrument HKY.OL on a 1-minute interval using Refinitiv's Python Software Development Kit (SDK). However, I'm consistently receiving NA values for both bid and ask sizes.

Here's the code I've been working with:


import datetime
import refinitiv.data as rd
rd.open_session()


## Set the datetime
start_date = datetime.datetime(2023, 1, 1).strftime('%Y-%m-%d')
end_date = datetime.datetime(2023, 2, 1).strftime('%Y-%m-%d')


## Fetch data from Refinitv
df = rd.get_history(
    universe= ['HKY.OL'],
    fields=['ASK', 'ASKSIZE', 'BID', 'BIDSIZE'],
    start = start_date,
    end = end_date,
    interval = '1min'
)
df


The fields ASK and BID return values as expected, but ASKSIZE and BIDSIZE are returning NA. I have verified that the instrument has data for the specified date range, but I am unsure if I'm using the correct field names or if there's an inherent limitation to the data's granularity. Here is my current output data:
skjermbilde-2023-09-26-kl-090054.png

Any guidance on how to correctly retrieve this data, or insights into potential issues, would be highly appreciated. Thank you!

python#contentpython apiprice-history
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.

Hello @s1810335

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

@s1810335

Thank you for reaching out to us.

The BIDSIZE and ASKSIZE fields are not valid fieds of 1 minute interval data of HKY.OL. You can remove the fields parameter to get all available fields.

The valid fields are:

Index(['HIGH_1', 'LOW_1', 'OPEN_PRC', 'TRDPRC_1', 'NUM_MOVES', 'ACVOL_UNS',
       'HIGH_YLD', 'LOW_YLD', 'OPEN_YLD', 'YIELD', 'BID_HIGH_1', 'BID_LOW_1',
       'OPEN_BID', 'BID', 'BID_NUMMOV', 'ASK_HIGH_1', 'ASK_LOW_1', 'OPEN_ASK',
       'ASK', 'ASK_NUMMOV', 'MID_HIGH', 'MID_LOW', 'MID_OPEN', 'MID_PRICE'],
      dtype='object', name='HKY.OL')

You can contact the Elektron Data Platform - Historical Pricing API support team directly via MyRefinitiv to verify if this endpoint can provide the BID size and ASK size.

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.