Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Proposed-change-to-RangeAccrual-classes-tp8905p8906.html
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
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev