From: Luigi B. <lui...@gm...> - 2009-07-28 09:25:28
|
On Wed, 2009-07-15 at 00:42 -0700, dhoorens wrote: > Actually my question is more general > Suppose I have to price a swap at 31/12/2008 > The only informations I have are the yieldCurve at 31/12/2008 and the > characteristics of the swap (notional, fixrate, index followed by floating > leg, maturity (frequencies of both legs are annual)) > > How can be the floating rate used for next coupon be determined by these > informations? > My idea was "it must be an input".. but i"m not sure If the floating coupon already started, you're right---it's an input, since it can't be retrieved from today's curve. From your previous mail, I see you already figured that it should be stored with the Index::addFixing method. To get the correct date, I'd do something like: boost::shared_ptr<CashFlow> currentCoupon = ...; boost::shared_ptr<FloatingRateCoupon> flt = boost::dynamic_pointer_cast<FloatingRateCoupon>(currentCoupon); iborIndex->addFixing(flt->fixingDate(), ...); Luigi -- A programming language is low-level when its programs require attention to the irrelevant. -- Alan Perlis |