question

Upvotes
Accepted
11 2 2 5

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



eikon-data-api#technology#producthistorical
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
15.6k 33 5 10

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


1668695042271.png (73.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
15.6k 33 5 10

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.


1668487266519.png (35.8 KiB)
1668487303913.png (54.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.