Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

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)

#productpython apitimeseries
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.

1 Answer

· Write an Answer
Upvote
Accepted
79.2k 251 52 74

@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



1691379764175.png (35.2 KiB)
1691379923026.png (23.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.

Thanks, this is just what I was looking for.

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.