RHistory in Python

imageI'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)

Best Answer

  • chavalit-jintamalit
    Answer ✓

    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)

    image