Does anyone have experience with the Python QuantLib function
I'm trying to produce a 3D plot of the volatility surface as done in the example
Here is my attempt, based on the data of the example
import QuantLib as quant heston_vol_surface = quant.HestonBlackVolSurface( quant.HestonModelHandle(model), quant.AnalyticHestonEngine.Gatheral) strikes_grid = np.arange(strikes, strikes[-1],10) expiry = 1.0 implied_vols = [heston_vol_surface.blackVol(expiry, s) for s in strikes_grid]
I understand that I need to pass the the volatility term structure, but my knowledge of QuantLib is too limited right now. Thanks for you help.