Login  Register

ATM cap volatility curve construction

Posted by tarpanelli@libero.it on Aug 13, 2010; 7:16am
URL: http://quantlib.414.s1.nabble.com/ATM-cap-volatility-curve-construction-tp8717.html

Hello,
I am creating a cap volatility curve (see the code below).
I have created correctly the yield term structure, the vector
atmVolatilityHandle (see the code) is well constructed (I used a cout in each
for step and the iATMVol used are well defined), but when I go to create the
capfloorATMVolCurve the following exception raise:
"not enough points to interpolate: at least 2 required, 0 provided"

iOptionTenors is an std::vector<Period> with the list of the option tenors
considered in the iATMVOL (e.g. 1Y,18M,2Y,3Y,4Y,5Y,6Y,7Y,8Y,9Y,10Y,12Y,15Y,20Y,
25Y,30Y); -> size ot iATMVol and iOptionTenors is the same.
iRefDate is the evaluationDate (which is the reference date of the yield term
structure).

Any suggestion?

Thanks and regards,
Paolo

/* START CODE */
std::vector<Handle<Quote>> atmVolatilityHandle;
atmVolatilityHandle.resize(nTenors);
int i=0;
for (i=0; i<nTenors; ++i) {
atmVolatilityHandle[i] = Handle<Quote>(boost::shared_ptr<Quote>(new SimpleQuote
(iATMVol[i])));
}
Handle<CapFloorTermVolCurve> capfloorATMVolCurve;
capfloorATMVolCurve = Handle<CapFloorTermVolCurve>(boost::
shared_ptr<CapFloorTermVolCurve>(new CapFloorTermVolCurve(iRefDate, iCal,
iRollConv, iOptionTenors, atmVolatilityHandle)));
/* END CODE */

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users