derivitec.core.client.DerivitecClient.get_equity_vol_index_vols¶
- DerivitecClient.get_equity_vol_index_vols(identifier, strike_type, strikes, maturity, start_date, end_date, market_data_environment_name=None)[source]¶
Get equity vol index vol surface vols between two dates.
- Parameters:
identifiers (list of InstrumentIdentifier) – The identifiers.
strike_type (StrikeType) – The strike type
strikes (list of floats) – The strikes in the format of strike_type.
maturity (int) – The maturity.
start_date (datetime) – The start date.
end_date (datetime) – The end date.
market_data_environment_name (str) – The market data environment name (optional with default Organisation Level Environment)
- Return type:
derivitec.market_data.response.ApiGetEquityVolIndexVolsResponse
Code
The strike is defined \(z ~ := ~ log(K/F)\) when strike_type is StrikeType.Logarithmic we can get 95% and 105% moneyness as follows:
>>> import math >>> strikes = [math.log(0.95), math.log(1.05)] >>> identifier = ric(".VIX") >>> start_date = datetime(2017, 6, 1) >>> end_date = datetime(2017, 7, 1) >>> strike_type = StrikeType.Logarithmic >>> maturity = 30 >>> market_data_environment_name = "Example Market Data Environment" >>> equity_vols = client.get_equity_vols(identifier, strike_type, strikes, maturity, start_date, end_date, market_data_environment_name)
Then we can manipulate the returned vol
>>> map(lambda x: x.Vols[1] - x.Vols[0], equity_vols.VolatilityData)