For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 1

RHistory in Python

I'm trying to recreate an Excel formula in Python. I have the RIC (JETFUSGCDFMc1) which I'm trying to get a timeseries of LAST price and DATE. For some reason I can only get the LAST price without the history. In Excel I used the "@RHistory" function. Can someone guide me how to pull up the history? It seems specific to this RIC, as I can get histroical data from HOC1 by using the following code:


HOc2, err = ek.get_data(instruments = ['HOc2'],


fields = ['TR.CLOSEPRICE', 'TR.CLOSEPRICE.DATE'],


parameters = {'Frq' : 'D','SDate': '2015-01-01', 'EDate' : '1D','CH' : 'date'})


display(HOc2)

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythoneikon-com-apiexcel
rhistory.png (60.0 KiB)
icon clock
10 |1500

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

@michael.jones01

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

Upvotes
Accepted
18k 21 12 20

Hi @michael.jones01

I think the data for "JETFUSGCDFMc1" was available from 2015-09-04.

This is my excel function:

=@RHistory("JETFUSGCDFMc1","NDA_RAW.Nda_date;NDA_RAW.Nda_last","START:01-Apr-2015 END:31-Dec-2015 INTERVAL:1D",,"SORT:ASC CH:Fd",B2)

And this is my Eikon Data API call:

df = ek.get_timeseries("JETFUSGCDFMc1", fields=["CLOSE"], start_date='2015-04-01', end_date='2015-12-31')
df.head(15)


ahs.jpg (227.6 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea