New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
3 2 3 5

Future Option time series data using Python EikonDesktopData API

Hi, I am trying to build historical volatility surface using Python EikonDesktopData API. I'd need to extract the following fields

PREMIUM, SPOT, STRIKE_PRC, STRIKE_PRC, DELIVERY MONTH, INTRST_RTE,

I am getting Null values for all the queries in the code below. Could you please help here, where I'm making mistake? Thanks.

import eikon as ek
ek.set_app_id('<my app id>')
strike = ek.get_timeseries(["LCO100N1MO=R"], start_date = "2018-05-01T15:04:05", end_date = "2018-05-05T15:04:05", interval="daily", fields=["STRIKE_PRC.Timestamp","STRIKE_PRC.Value"])

interest = ek.get_timeseries(["LCO100N1MO=R"], start_date = "2018-05-01T15:04:05", end_date = "2018-05-05T15:04:05", interval="daily", fields=["INTRST_RTE.Timestamp","INTRST_RTE.Value"])

spot = ek.get_timeseries(["LCO100N1MO=R"], start_date = "2018-05-01T15:04:05", end_date = "2018-05-05T15:04:05", interval="daily", fields=["SPOT.Timestamp","SPOT.Value"])

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apifuturesvolatility
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
11.1k 22 6 9

@Sanjit.Rath you can get a snapshot using the get_data Python API call using the following:

fields1 = ['PREMIUM', 'STRIKE_PRC', 'RISK_FREE', 'CF_CLOSE', 'EXPIR_DATE']

newins = ek.get_data('LCO100N1MO=R', fields=fields1)[0]

newins.head()

But as Zhenya states, you will have to wait for the history to be available in Q2 to calculate the historical vol surface.

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
4.6k 27 7 22

@Sanjit.Rath none of the views that you need ('STRIKE_PRC', 'INTRST_RTE' and 'SPOT') are supported by the beta timeseries API. You can only get the close price, that refers to the default view ('LAST_QUOTE'):

This functionality will be added in the first official release some time in Q2.


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.

Hi @Zhenya Kovalyov, Thanks for the explanation. Is it possible to get the the values using COM API . I tried AdxRtHistory but it expects fields in the old format not as shown below.. Do you know if we have old field names for the below?

["STRIKE_PRC.Timestamp, "STRIKE_PRC.Value"]

@Sanjit.Rath if you are using it outside of Excel, the best choice would be the .NET API, as with AdxRtHistory you might run into a completely different set of issues. Have a look at Views and Intervals section of the time series tutorial, if you can use .NET for this task.

If you can do VBA inside of Excel, I can recommend RHistory COM API, here is the tutorial.

If you're looking to retrieve the data into Excel VBA you can use RHistory COM API. Here's the link to the tutorial. For custom applications the only API that can currently provide these values is Eikon .NET API. Here's the tutorial for retrieving this data into .NET application.

Hi @Alex Putkov., Thanks for the reply. Yes I was looking at RHistory COM API but it is not registered by default. This is required for loading it into python win32com. I tried to call "regsvr32 RhistoryAPI.dll" but it fails with an error. I presume DllRegisterServer function is not implemented or there are other issues preventing registration.

Regarding the .NET API, it is much better than the COM APIs but client is interested in keeping all coding to Python. It would be possible to use python if RHistoryApi.Dll can be registered.

Do you know if is possible to register?

Show more comments

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.