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
5 0 1 2

How can I get real time data for EUR= in python? 1 minute interval.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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
21.8k 57 14 21

Hi @fredy.sarmiento, You can call the Eikon get_data call repeatedly, whenever you need the current real time price for an instrument. For 1 minute, this call can be placed in a one minute loop.

>>> while True:
...     df,err = ek.get_data('EUR=', ['BID','ASK'])
...     print(df)
...     time.sleep(60)
...
  Instrument    BID     ASK
0       EUR=  1.108  1.1084
  Instrument    BID     ASK
0       EUR=  1.108  1.1082

The new version of Python Data API (currently EAP) also allows subscribing to streaming data.

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.

Fantastic !!
Many thanks

Hi @Gurpreeet

It worked once but now I am getting an error message:
"NameError: name 'time' is not defined"

Also, I was trying to get the Close Price but I got NaN.


My eikon version is

1.1.2b0


Thanks for your help

Upvotes
21.8k 57 14 21

You will have to import the time module in python:

import time

You can search/use the "Data Item Browser" within Eikon to see the list of fields available to you.

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
5 0 1 2

@Gunpreet

Awesome !! many thanks


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
5 0 1 2
Hi @Gurpreet, Thanks for your help before and Ii was wondering if you know how to do the following request:

Request the last 300 data points from now, in 1-minute interval for EUR and get real-time updates every minute. Basically, creating a constant flow of 300 data points that updates in real-time.


My objective is to replicate and calculate some technical analysis indicators, or even better I am not sure if I can directly request technical Analysis indicators?


Many thanks

Fredy

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.

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.