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

Eikon Python API - real time prices after market closes for sugar No.11 (SBC) and sugar No.5 (LSUc)

Hi, I am trying to get the real time prices of sugar No.11 (SBC) and sugar No.5 (LSUc) after the market closes. The real time data seems to only be available at 9pm UK time (3 hours after market close) some of the data is not returned. We often don't receive values for open interest/change/volume and intraday prices (minute by minute) returns data from the previous trading day.

This is the code I use to get the settlement price - it only returns the real time data for current trading dat around 9pm UK time which is extremely late.

start_date = str(datetime.date.today() - datetime.timedelta(45))

end_date = str(datetime.date.today())

settle_tables, err = ek.get_data('/SBc1',

['TR.SETTLEMENTPRICE.date',

'TR.SETTLEMENTPRICE'],

{'SDate': start_date, 'EDate': end_date})

We used the code below to get the 1 minute prices however that only returns data up until the previous trading day and not the current day.


df_sbc1 = ek.get_timeseries(['/SBc1'],

start_date = start_date,

end_date = end_date,

fields = ['*'],

interval = 'minute')

What code do we need to use to get the settlement price for the trading day right after the market closes and the minute prices for the trading day?



eikon-data-apirefinitiv-realtimepython apithomson-reuters
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 @BSeed

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

@BSeed

Hi,

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

Thanks,

AHS

1 Answer

· Write an Answer
Upvote
Accepted
79.2k 251 52 74

@BSeed

If you would like to get the last price, you can access real-time fields instead, such as CF_LAST.

The code looks like this:

settle_tables, err = ek.get_data('/SBc1',
                                 ['CF_LAST'])
settle_tables

The real-time fields are fields displayed on Eikon Quote.

For the 1 minute prices, you need to specify the time in the end date.

df_sbc1 = ek.get_timeseries(['/SBc1'],start_date = start_date,end_date = end_date+"T23:59:59",
                            fields = ['*'],
                            interval = 'minute')
df_sbc1

The output is:

1657183979347.png



1657183979347.png (33.2 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.