CapFloor surfaces

Posted by Shuaib Osman on
URL: http://quantlib.414.s1.nabble.com/CapFloor-surfaces-tp5575.html

Hi guys,

I'm still learning QuantLib so appologies in advance if this is something trivial. I'm trying to price some caps/floors in python. I've managed to create a list of IborCoupons and an IborIndex for the instrument easily enough. When I try to use the BlackCapFloorEngine the second parameter is a Handle to a OptionletVolatilityStructure (not a CapFloorTermVolCurve). I've been looking at the source and have not yet seen a derived class of OptionletVolatilityStructure which supports a strike/term vol surface (like CapFloorTermVolSurface - which is not even exported to python).

The strange thing is that the CapFloorTermVolCurve is listed in old_volatility.i in the SWIG directory - implying that there's a more recent way to create a strike/term surface (presumably using the OptionletVolatilityStructure Base class) - but the only derived class I've seen so far is the ConstantOptionletVolatility (which is useless as I need a surface). The SpreadedOptionletVolatility class only works if you already have an existing OptionletVolatilityStructure object and the CapletVarianceCurve is deprecated. I don't know what/how to use the StrippedOptionlet class that the comments in the source points to.

How do I go about creating a OptionletVolatilityStructure with strikes/dates for the BlackCapFloorEngine?

Thanks.