Is there any way to return specific time every day? For example, I want to retrieve close price for

Is there any way to return specific time every day? For example, I want to retrieve close price for 8 pm for GEL= with daily interval as time series. A solution for any api is welcome.

Best Answer

  • raksina.samasiri
    Answer ✓

    hi @bohdan.vahalik ,

    In case you'd like to get historical data, you could use Eikon Data API get_timeseries to get hourly data

    df =  ek.get_timeseries(['GEL='],
    ['CLOSE'],
    start_date='2022-06-01T20:00:00',
    end_date='2022-06-24T20:00:00',
    interval='hour')
    df

    then filter only the row with a time equal to 20:00 (please note that this timestamp is GMT, so it needs to be converted to the desired timezone)

    import datetime
    df.loc[datetime.time(20,0)] #20:00 GMT

    1656041544664.png

    Hope this helps

Answers