question

Upvotes
Accepted
1 1 1 1

How to get historical closing price for ric *=RRPS through Eikon API with python?

I am trying to get the historical closing price for *=RRPS (e.g. AT0000A1K9C8=RRPS, BE352=RRPS)


df_r,e = ek.get_data(' BE291=RRPS' ,['TR.PriceClose'],

{'SDate':'2022-01-01','EDate':'2022-06-30','Frq':'D'})

CF_CLOSE doesn't work for historical prices

screenshot-2022-07-12-162814.jpg

I tried ek.get_timeseries but it returned the close yield.

df = ek.get_timeseries([ 'BE352=RRPS' ] ,fields="CLOSE" , start_date = '2022-01-01', end_date = '2022-06-30')


2.jpg


eikoneikon-data-apipythonhistoricalprice-history
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
Accepted
7.2k 23 3 6

Hi @rinnie.cheung ,


Please use the DIB to find the field that you are after. You can use the cog (top right) to filter for series datapoints for which you can look for historical data:


1657705367252.png



import refinitiv.data as rd
rd.open_session()
df3 = rd.get_history(
    universe=["BE291=RRPS"],
    fields=["TR.MIDPRICE", "TR.MIDYIELD"],
    interval="1D",
    start="2021-10-01",
    end="2022-06-01",
)
display(df3)
rd.close_session()

1657705540705.png


Daily data using the rd.get_history function returns end-of-day datapoints, be it Bid, Ask or Mid, apart from if mentioned otherwise in the DIB.


1657705367252.png (157.3 KiB)
1657705540705.png (27.8 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.

would that be equivalent to
df_r,e = ek.get_data(' BE291=RRPS' ,['TR.BidPrice.Date','TR.BidPrice','TR.AskPrice'],

{'SDate':'2022-01-01','EDate':'2022-06-30','Frq':'D'})


do these fields capture the last bidprice and last ask price of the day?

Hi @rinnie.cheung , yes it is the same. Data comes from the same endpoints.
Thanks Jonathan. Would you know the timestamp when these data were captured?
Show more comments
Upvotes
19.2k 86 39 63

Hi @rinnie.cheung

Can you provide the version of the Eikon Data API you are using? When I tried the code snippets you posted above, the opposite worked for me. For example:

ahs.png


ahs.png (16.3 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.

My Eikon API version is 1.1.14. the values in your numbers are yield, but i am looking for the price


screenshot-2022-07-13-082903.jpg

if you check Eikon, the price should be a double digit value.

Would you please advise?

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.