Historical Inflation swap data from ek.timseries giving bid rather than mid

I'm trying to get historical mids for inflation swaps in Python. My current code is

ek.get_timeseries("GBRPIZ1Y=", start_date="2023-08-01", end_date="2023-08-04", interval='daily')

However, this gives bid values not mids.

Is there a way to get mids instead?

I can get them in Eikon Excel using

=RHistory("GBRPIZ1Y=","MID_PRICE.Timestamp;MID_PRICE.Close","START:01-aug-2023 END:04-Aug-2023 INTERVAL:1D",,"TSREPEAT:NO CH:Fd",I2)

Best Answer

  • Jirapongse
    Answer ✓

    @George Gent

    Thank you for reaching out to us.

    The ek.get_timeseries method can only retrieve the default view of historical data. For GBRPIZ1Y=, it should be BID view.

    To get other views, you need to use Refinitiv Data Library for Python instead. The examples are available on GitHub.

    The RD Library can connect to the desktop session which is the same session used by Eikon Data API. You can configure the application key in the RD configuration file.


    1691379764175.png

    Change the default session to "desktop.workspace" and set the "app-key" configuration. Then run the EX-2.01.01-HistoricalPricing.ipynb example with the followiing code.

    response = historical_pricing.summaries.Definition(
        universe=['GBRPIZ1Y='],
        start="2023-07-31",
        end="2023-08-04",
        fields=["MID_PRICE"]
    ).get_data()
    response.data.df

    1691379923026.png


Answers