Hello,
I am using quantlib to create and price a few interest rate swaps and associated bonds to show some hedging relationships. I have written code which loads a series of treasury and libor rates for specific month-end dates, and have created curves for each month end. My code then creates a swap with a handle to a specific discounting and forecasting term structure. I point the handles to each month end curve, change the evaluation date to the date of the curve, and then try and perform an NPV of the swap. 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... Would anyone be able to provide me with some help or guidance? Thanks to anyone who responds in advance for their time and help! Sincerely, Jay |
Hi Jay
it is not crystal clear to me what you're doing (and the exact error message would help) but my guess is that moving the evaluation date ahead some of your deals might become seasoned deals and need historic fixings. ciao -- Nando On 10/5/06, Jawahar J. Panchal <[hidden email]> wrote: > Hello, > > I am using quantlib to create and price a few interest rate swaps and > associated bonds to show some hedging relationships. I have written code > which loads a series of treasury and libor rates for specific month-end > dates, and have created curves for each month end. > > My code then creates a swap with a handle to a specific discounting and > forecasting term structure. I point the handles to each month end curve, > change the evaluation date to the date of the curve, and then try and > perform an NPV of the swap. > > 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... > > Would anyone be able to provide me with some help or guidance? Thanks to > anyone who responds in advance for their time and help! > > Sincerely, > Jay > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
In reply to this post by Jawahar J. Panchal
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. |
Free forum by Nabble | Edit this page |