Is there an interval type 30 minutes for python api?
Best Answer
-
To create timeseries in 30 minute interval you'd need to retrieve 1 minute bars and summarize them into 30 minute bars.
0
Answers
-
Hi,
If you wonder if get_timeseries function accepts other interval type than 'tick', 'daily', ... , the response is no.
0 -
thanks a lot!
0 -
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?
0 -
I hope there got 5mins, 30mins,hour.....
0 -
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.
0 -
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)0 -
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() }
0 -
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
0 -
Well, your use case is borderline outside what a market data terminal can handle. If indeed you're looking to construct 5 min bars in real-time, i.e. form the continuation of the bars live from the real-time data stream, then you definitely cannot do this using hosted (aka Internet delivered) Eikon, as your concurrent real-time data subscriptions are limited to 2.5K RICs.
0 -
Eikon Python API currently does not provide streaming market data at all. But even if you used Eikon .NET API, which does provide 5 min bars and live continuation from real-time data stream, you'd still be subject to 2.5K RICs cap on the number of concurrent real-time data subscriptions.
0 -
Using Eikon your only option would be to poll the timeseries service every 5 minutes for a new 5 min bar if you use .NET API or for 5 new one minute bars if you use Python API. This won't give you the updated 5 min bar in real-time, there certainly will be some delay. How well this will work for 3K RICs if you do it continuously every 5 minutes? There's only one way to find out, but my guess is probably not fully reliably. You should be prepared that some requests will fail and you might need to resubmit, which would result in further delay in obtaining the new bar.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛