|
From: Luigi B. <lui...@gm...> - 2011-01-10 16:23:04
|
On Wed, 2010-12-22 at 14:17 +0100, Andreas Spengler wrote: > I am currently looking into the classes surrounding the RangeAccrualLeg; > as there are variations of those on the market which (at times) pay out a > portion of a fixed coupon instead of a portion of an index, I would > propose the addition of an "alternativeFixedRate" member as outlined > below. > > Could someone give me a hint as to how I would integrate this alternative > into the "RangeAccrualPricer"s; also, how would I go about integrating the > spread into the accrual formula? [(3M-Libor + x% spread) * n/N - where n > is the # of days in the period that satisfy the range condition and N is > the total # of days in the period...] You might consider writing a different coupon class instead of adding another parameter to the existing one---especially since the formula for pricing the coupon with alternative spread would be different (a sum of digital options on Libor, possibly?) Trying to shoehorn both inside the pricer might be a bit of a tall order, seeing as it's quite complex already. Also, inheriting your new class from Coupon instead of FloatingRateCoupon might allow you to skip the pricer machinery and just override the rate() method, which would be simpler. You might switch to a pricer later, if you need more methods to price the coupon. Luigi -- A debugged program is one for which you have not yet found the conditions that make it fail. -- Jerry Ogdin |