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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 1

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

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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
13k 32 12 18

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 5.0 MiB each and 10.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
13k 32 12 18

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 5.0 MiB each and 10.0 MiB total.

Upvotes
5 0 0 1

@Gunpreet

Awesome !! many thanks


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
5 0 0 1
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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea