derivitec.core.client.DerivitecClient.get_vol¶
- DerivitecClient.get_vol(surface, maturity, strikes, strike_type)[source]¶
Get vol from a volatility surface at a fixed maturity for a set of strikes. This can be called with any SVI surface i.e. EquityVolSurface, CmdtyVolSurface and FxVolSurface.
- Parameters:
maturity (int) – The maturity.
strikes (list of float)
strike_type (
derivitec.market_data.types.VolatilitySurfaceSvi.StrikeType) – The strike type.
- Return type:
list of float
Code Query for ATM 30 day maturity vol
>>> commodity_id = CommodityId(Name="Aluminium", Exchange="LME") >>> commodity_ids = [commodity_id] >>> market_dates = [datetime(2017, 10, 2)] >>> cmdty_vol_surfaces = client.get_cmdty_vol_surfaces(commodity_ids, market_dates) >>> client.get_vol(cmdty_vol_surfaces[0], 30, [0], StrikeType.Logarithmic)