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

Is there an interval type 30 minutes for python api?

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apidatahistorical
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
39.4k 77 11 27

To create timeseries in 30 minute interval you'd need to retrieve 1 minute bars and summarize them into 30 minute bars.

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.

Thanks ,after i get data via

df1=ek.get_timeseries(s1,fields=["Open","High","Low","Close","Volume"], start_date = "2017-11-13T01:00:00",end_date = "2017-11-13T07:04:05",interval='minute')

Do u have any high effect ways to handle this data into 5mins bar?

There's nothing from Thomson Reuters that would facilitate this operation, since Python has very rich capabilities for all kinds of data transformation, summarization and statistical analysis.

Alex, thanks for your answer. Of course You are right since Pyhon has very rich libs for calculation, but my requirement is to get 3000 RICs' 5mins bar in real-time, do you have any efficient way to handle this? thanks again :)

Show more comments
Upvotes
4.3k 2 4 5

Hi,

If you wonder if get_timeseries function accepts other interval type than 'tick', 'daily', ... , the response is no.

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.

I hope there got 5mins, 30mins,hour.....

Upvotes
1 0 2 3

thanks a lot!

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
4.3k 2 4 5

This a simple example to extract a 30 minute interval timeseries from a minute interval result:

import eikon as ek
from datetime import timedelta

interval = 30

def ohlcsum(df):
    return [df['OPEN'][0],df['HIGH'].max(),df['LOW'].min(),
           df['CLOSE'][-1],int(df['VOLUME'].sum())]

data_1min = ek.get_timeseries('PEUP.PA', interval='minute')
timestamps=[]
result=[]
start_slice = data_1min.index[0]
while True:
    end_slice = start_slice + timedelta(minutes=interval-1)
    interval_slice = data_1min.loc[start_slice : end_slice]
    try:
        data = ohlcsum(interval_slice)
    except IndexError:
        break
    timestamps.append(interval_slice.index[-1])
    result.append(data)
    start_slice = start_slice + timedelta(minutes=interval)
    if start_slice > data_1min.index[-1]:
        break

labels = ['OPEN','HIGH','LOW','CLOSE','VOLUME']
data_new_interval = pd.DataFrame.from_records(result, index=timestamps, columns=labels)
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.

I don't think u got the right data for 5 min

for every 5 min data, it should be calculated by the following function

def ohlcsum(df):
    df = df.sort()
    return {
       'Open': df['Open'][0],
       'High': df['High'].max(),
       'Low': df['Low'].min(),
       'Close': df['Close'][-1],
       'Volume': df['Volume'].sum()
      }

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.