is there a way to pull historical implied equity vol surfaces (e.g. .STOXX50E) to python via eikon app or datastream app?
I don't believe the forwards and the dividends used to calculate the surface are available historically in Eikon. Strikes corresponding to the moneyness levels expressed in delta are available, but at the moment they can only be retrieved using legacy Eikon .NET API.
At the datafeed we only calculate the surface using the moneyness points expressed in delta. If you retrieve corresponding strikes you could interpolate the curve for the moneyness points expressed as percentage of spot. But as I said, currently the only interface available in Eikon that provides programmatic access to the strikes historically is Eikon .NET API.
The method @chavalit.jintamalit provided can only work for a short period of time back into the history until the most recent rollover date for the options. For any date prior to the most recent rollover date the composition of the options chain will be different from the current composition. We do however have a volatility surface for this index defined in terms of tenor and moneyness, which are invariant over time. This volatility surface is available from the chain 0#STXEVOLSURF. Here's an example of constructing this surface on a historical date.
chain_df, err = ek.get_data('0#STXEVOLSURF',['GV3_TEXT','GV4_TEXT']) moneyness_labels = chain_df['GV4_TEXT'].tolist()[:17] vol_surf_df = pd.DataFrame(columns= moneyness_labels) ric_list = chain_df['Instrument'].tolist() chain_df.set_index('Instrument', inplace=True) chunksize = 50 for i in range (0, len(ric_list), chunksize): tmp_df = ek.get_timeseries(ric_list[i:i+chunksize], start_date='2018-07-16', end_date='2018-07-16') for x in tmp_df.columns: vol_surf_df.loc[chain_df.loc[x,'GV3_TEXT'], chain_df.loc[x,'GV4_TEXT']] = tmp_df[x] vol_surf_df
Thanks, Alex. That's exactly what I was looking for. Is it also possible to pull the corresponding forwards and dividends? How far into the past can I go? When I try pulling 2017 data, I get the error 'No data available for the requested date range'.
Also I would prefer the moneyness in terms of moneyness not delta (i.e. 95%, 100%, 105%... instead of 45DPut, ATM, 45DCal). What is the name of that field. I was looking at the data item browser in eikon but could not find anything helpful.
These chains are only available for a handful of world indices. For individual stocks and ETFs you can retrieve volatility surface using TR.SurfVolMONEYNESS field, e.g.
ek.get_data('HYG',['TR.SurfVolMONEYNESS.Tenor', 'TR.SurfVolMONEYNESS.Range','TR.SurfVolMONEYNESS'])There's no history available for these surfaces.