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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 1

Is it possible to replicate in python the data I see on a chart in real time in eikon? For example, EUR, be able to download the last 2 days on 1 minute data and keep getting the real time updates?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
eur.jpg (80.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
18k 21 12 20

Hi @fredy.sarmiento

First, you can use get_timeseries to get 2 days amount of 1-minute data.

Then if you still want 1-minute data, you can loop the call every 1 minute to get 1-minute data

Or if you need realtime data, you can use StreamingPrice API call to get the realtime data. Please refer to this document.


ahs.png (23.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thanks a lot !!

Upvotes
13k 32 12 18

Hi @fredy.sarmiento, Replying to you in this thread, since it is more relevant to your new question. As Chavalit mentioned, you can use the get_timeseries API call to get the historical data and combine it with get_data call as described in other thread to get minute updates.

So essentially:

df = ek.get_timeseries('EUR=', fields=['CLOSE'], count=10, interval='minute')
while True:
  df2,err = ek.get_data('EUR=', ['CF_CLOSE'])
  print(df2)
  time.sleep(60)

You might want to append to the dataframe, if you need one continuous series:

df2.columns = ['Instrument', 'CLOSE']
df.append(df2)

                       CLOSE  Instrument
2020-01-21 16:04:00    1.1098        NaN
2020-01-21 16:05:00    1.1098        NaN
2020-01-21 16:06:00    1.1097        NaN
2020-01-21 16:07:00    1.1096        NaN
2020-01-21 16:08:00    1.1097        NaN
2020-01-21 16:09:00    1.1099        NaN
2020-01-21 16:10:00    1.1096        NaN
2020-01-21 16:11:00    1.1097        NaN
2020-01-21 16:12:00    1.1097        NaN
2020-01-21 16:13:00    1.1095        NaN
0                      1.1094       EUR=

There is technical analysis fields available as well (don't seem to be working for FX instruments though):

Get Moving averages:

>>> df3,err = ek.get_data('IBM.N', fields=['TR.Price200DayAverage','TR.Price50DayAverage', 'TR.MovAvgCDSignal', 'TR.PriceMoVolatilityDly'])
>>> df3
  Instrument  200-day SMA  50-day SMA  MACD - Signal  Price Momentum Daily Volatility
0      IBM.N     137.9519    134.8674       0.391135                          1.19946
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@Gurpreet !

Many thanks !! much appreciated it.

Click below to post an Idea Post Idea