TRDPRC_1.Close Need historical data at a specific time of the day

Can you please suggest a script in Eikon Python API that can capture 1 Min Interval at a specific time of the day for multiple dates?


The Eikon Excel formula we are using is,

=RHistory(B$3,"TRDPRC_1.Close","START:"&$A4+$D$1&" NBROWS:1 INTERVAL:1M",,"TSREPEAT:NO SORT:ASC")


where B3 is FXXPZ2

A4 is October 19, 2022

D1 is 18:00



Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @kenley.macandog123 ,

    You could do the resampling:

    df = ek.get_timeseries('TRI.N', 'CLOSE', interval='hour')
    df1 = df.iloc[lambda df: df.index.hour == 18,:]

    But you can only get the timeseries going back as far as the hourly history goes, which is about 3 months.

    I Hope this helps and please let me know in case you have any questions

    1668695042271.png

Answers

  • Hi @kenley.macandog123 ,

    Is this what you're looking for? end_date can be added to specified the specific data period

    import refinitiv.data.eikon as ek
    ek.set_app_key('### YOUR EIKON APP KEY ###')

    ek.get_timeseries(['FXXPZ2'],
    start_date='2022-10-19 18:00',
    interval='minute')

    1668487266519.png

    Plus, to check the available parameters of the function, you may use

    help(ek.get_timeseries)

    1668487303913.png

    Hope this helps and please let me know in case you have any further questions.

  • @raksina.samasiri


    Thank you for the info above.


    Is there a script you know that can pull up one entry on a daily basis?


    I know the script above and it pulls up the data based on a time range. I need to know if it's possible to get one value at 18:00 on a daily basis. I also need to use the specific data item TRDPRC_1.Close


    Appreciate the assistance.