Re: Question on IRS pricing

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Question-on-IRS-pricing-tp5089p5090.html

On Wed, 2006-10-04 at 20:52 -0500, Jawahar J. Panchal wrote:
> This seems to only work for the 1st curve (which is on the settlement date
> of the swap), and afterwards I get the following error:
>
> terminate called after throwing an instance of 'QuantLib::Error'
>   what():  USDLibor3m act/360 history not loaded
>
> I have checked that I have a curve for each date, and that my evaluation
> date matches the date of the curve - so am not sure why the error states
> that there is no history loaded...

If your evaluation date is past the start of the swap, the fixing of the
first Libor coupon becomes a "historical" one---it cannot be forecast
and has to be provided instead. Assuming you're using QuantLib 0.3.13,
the easiest way to do it is to execute the following code:

USDLibor libor(3*Months);
libor.addFixing(fixingDate, rate);

where fixingDate is the fixing date for the coupon (most likely, two
business days before the start of the coupon) and rate is the
corresponding fixing.

Later,
        Luigi


----------------------------------------

No, I'm not interested in developing a powerful brain. All I'm after
is just a mediocre brain, something like the president of American
Telephone and Telegraph Company.
-- Alan Turing on the possibilities of a thinking machine, 1943.