Hi there, I'm still struggling with this volatility cube function.
I managed to create an ATM volatility surface using
qlSwaptionVTSMatrix(). I believe I did it right because the qlNPV()
function on a swaption object returns the expected number. I wanted to
go one step beyond that and create a Volatility cube.
One thing first: I noticed that for the ATM volatility I don't have to
create qlSimpleQuote() object like I had to do for curves so I assumed
that I could do the same for the volatilities quotes I'm passing to the
qlSwaptionVolatilityCubeByLinear().
Next: I'm getting from Bloomberg OTM spread volatilities for certain OTM
(-2%, -1%, -0.5%, -0.25%, +0.25%, +0.5%, +1%, +2%) strikes spreads vs.
ATM strikes.
I ordered by expiry (3m, 1y, 5y, 10y, 20y, 30y) and by tenor lenght (2y,
5y, 10y, 20y, 30y) those volatilities spreads over ATM volatility
putting expiry by column and tenor lenght by row repeting them for every
swap strike spread.
Which means I'm using a vector like {3m, 1y, 5y, 10y, 20y, 30y} for the
Expiries argument, a vector like {2y, 5y, 10y, 20y, 30y, ..., 2y, 5y,
10y, 20y, 30y} (repeated 8 times like the number of strikespreads
available) for the SwapLenghts argument, a vector like {2%, 2%, 2%, 2%,
2%, 1%, 1%, ..., -2%} (sure you got that by now) for StrikeSpreads
argument, and a matrix of the corresponding volatilities spread for the
Volatilities argument (by value, not by object: I mean I'm not wrapping
those quotes with qlSimpleQuote()).
I must add I'm quite lost about the following two arguments:
ShortTenor & IndexShortTenorID: I've already used the IborIndexID for
the floating leg of the underlying swap. What am I supposed to use
there? ShortTenor has to be a double while IndexShort* is an object.
Beside that I can figure out what to put there.
thanks. Matteo
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://sourceforge.net/mailarchive/forum.php?forum=quantlib-users/attachments/20070104/1849b8d2/attachment.html