Intraday asset prices best practices

i'm trying to pull out intraday asset prices to compute intraday asset returns. I used =ek.get_timeseries and then specify the interval as minute. Is this the best way to do it? I saw there is another function StreamingPrices but i'm not sure it works for equity assets.
Also is there a function that can handle more than 300 instruments?
thanks
Francis
Best Answer
-
get_timeseries() is used to get historical data.
It can be interday or intraday.
StreamingPrices is a realtime subscription.
It means that you will get the data from the time you open a subscription and subsequence updates(if any). You have to handle what to do with the updates you get.
It does not provide historical data retrieval capabilities.
You can try the StreamingPrices in "CODEBOOK" app (Type in CODEBOOK in Eikon Search and launch the app).
Then browse to \Examples\02 - Refinitiv Data Platform Library
0
Answers
-
Also is there a function that can handle more than 300 instruments?
- I would suggest that you contact your Customer Success Manager to discuss your requirements.
Eikon Data API is a desktop product.
There are other Enterprise products which may serve your requirement better.
0 -
@diarmuid.omahony You would use the get_timeseries API call to get intraday history. In short API limits are applied to all our APIs and you can find out details here - for get_timeseries:
- get_timeseries: The current limit value (10-Oct-2019) is 3,000 data points (rows) for interday intervals and 50,000 data points for intraday intervals. This limit applies to the whole request, whatever the number of requested instrument
So you have upto 50k datapoints per API call which you can configure in any way you need them - so say you want equity data that trades for say 8 hrs a day that would be 8hrs x 60min =480 mins per ric per day say (you need to check these Im just giving the logic here). So you can chunk a longer list of RICs into appropriate chunks to get a full dataframe back and then concatenate them - here please look at the sample code below which does this for the S&P 500 index:
First define our chunks routine:
def chunks(l, n):
for i in range(0,len(l),n):
yield l[i:i+n]next we get a long list of RICs in this case for 0#.SPX (S&P500) - we then iterate over chunks and concatenate resultant dataframes:
data1 = pd.DataFrame()
univ,err = ek.get_data('0#.SPX','TR.CommonName')
long_ric_list = univ['Instrument'].astype(str).values.tolist()
ric_chunk = list(chunks(long_ric_list, 100))
for r in ric_chunk:
df = ek.get_timeseries(r,['CLOSE'],start_date='2021-03-26',interval='minute',count=500)
if len(data1):
data1 = data1 = data1.join(df)
else:
data1 = df
data1Obviously - you can change the amount in each chunk to suit your needs - or say if you wanted a long history for 1 RIC you could just iterate for each RIC in universe and get 50k rows per instrument back. I hope this can help.
0 -
Hi Team and @jason.ramchandani, many thanks for helping as the user is happy with your input as posted above. However, he has a follow up in relation to the codes given above. Below is his verbatim.
"I see in the Example notebook StreamingPrices works only with currencies, does it also work with equity assets? I’m trying to run the code with AMZN.OQ but I got N/A"
Can someone please advise? Thanks in advance!0 -
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 630 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛