For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

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.

1 Answer

Upvote
Accepted
52.9k 136 44 63

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