|
From: Luigi B. <lui...@gm...> - 2010-10-27 14:36:27
|
On Wed, 2010-10-27 at 11:51 +0200, Ahmad Mahomed wrote: > 1) The actual error is being thrown from the > `discountingswapengine.cpp` calculate routine specifically around > these lines. The fact that the error is showing 2nd leg implies to me > that the loop fails at the second iteration (there should be only two > loops since there are only two legs). The only code here that deals > with Handles and pointers from what I gather relate to the > 'discountCurve_'. No, the discount curve seems fine (or the engine would blow at the first iteration.) My guess is that you don't pass to your Jibar index the risk-free curve: > VanillaSwap impliedSwap = new VanillaSwap( > _VanillaSwap.Type.Payer, > 10000000.0, > fixedSchedule, > 0.1, > Actual365FixedDayCounter, > floatSchedule, > new Jibar(new Period(Frequency.Quarterly)), > 0, > Actual365FixedDayCounter); without a term structure, the Jibar above can return past fixings but not forecast future ones. If you replace the Jibar constructor above with new Jibar(new Period(Frequency.Quarterly), DiscountingTermStructure) it might work (unless there are other similar places in the code that we're not seeing...) Luigi -- The idea that an arbitrary naive human should be able to properly use a given tool without training or understanding is even more wrong for computing than it is for other tools (e.g. automobiles, airplanes, guns, power saws). -- Doug Gwyn |