get_data Time parameter. Python

Hello, I'm using Python.

I want to retreive the BID/ASK of Eur at a specific time(seconds).

I'm using data, error=ek.get_data('EUR=', ['TR.ASKPRICE.Date', 'TR.ASKPRICE','TR.BIDPRICE'], parameters={'SDate':'2018-06-20', 'EDate':'2018-06-22'})

I would like to Know how to Change the SDate EDate format and add Hour/min/sec to it.

thank you

Best Answer

  • nick.zincone
    nick.zincone admin
    Answer ✓

    Hi @e-naji,

    If you are interested in intraday activity, use the get_timeseries() method call. With that you can narrow down your time range and specify the granularity of the measure using the available options for the interval parameter. For example:

    df = tr.get_timeseries( 'EUR=', start_date='2018-06-20T09:25:00', 
    end_date='2018-06-20T16:01:00',
    interval='minute' )

    Note: See this post which provides additional details around the interval and what to expect.

Answers