Unable to link volatility structure to swaption pricing engine

Good morning,

I am trying to link the volatility surface to my swaption pricing engine.

swaptionVolMatrix = ql.SwaptionVolatilityMatrix(calendar, rollConvention, optionTenors, swapTenors, ql.Matrix(normal_vols),dayCountConvention, False, ql.Normal)
#Matrix is a 8x6 shape

swaptionVolHandle = ql.SwaptionVolatilityStructureHandle(swaptionVolMatrix)
swaptionVolHandle.enableExtrapolation()


I get the following error:

RuntimeError: BlackSwaptionEngine requires (shifted) lognormal input volatility here:

blackEngine = ql.BlackSwaptionEngine(discountingTermStructure, swaptionVolHandle)


I have tried to follow this from the documentation:

Do I need to extrapolate manually first then? And insert just the quote value?

• The error message says that the Black surface requires lognormal vols. You provide the argument ql.Normal when setting up SwaptionVolatilityMatrix. I think you simply need to change accordingly. Nov 11, 2021 at 9:32