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

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

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

    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.

Answers

  • https://community.developers.refinitiv.com/discussion/comment/54378#Comment_54378

    Fantastic !!
    Many thanks

  • https://community.developers.refinitiv.com/discussion/comment/54378#Comment_54378

    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

  • 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.

  • @Gunpreet

    Awesome !! many thanks


  • 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

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.