6
$\begingroup$

Wandering through QuantLib's Financial instruments documentation, I noticed no class for fixed-to-floater bonds exist.

Then I was wondering what a suitable way to price such an instrument would be without the need to create a new class (in fact, fixed-to-floater should be just the discounted sum of a fixed rate bond and a floating rate one).

My idea is the following:

  1. to extract the clean price from an object of class FixedRateBond whose Schedule has termination date equal to the "swap" date and whose redemption is equal to zero;
  2. to extract the clean price from an object of class FloatingRateBond whose issue date is equal to the "swap" date;
  3. to sum 1 and 2.

Is the above proceeding correct?

Is there any faster way?

$\endgroup$

1 Answer 1

5
$\begingroup$

I believe it's correct. However, consider that it would be easy enough, and more clear, to create a new class (at least in C++; the task is more difficult if you also want to export it to Excel). The new instrument should only inherit from Bond and implement a constructor that builds the desired cash flows via a call to FixedLeg and another to IborLeg; you can look at the constructors of FixedRateBond and FloatingRateBond to see how it's done. Any other functionality would be inherited from the Bond class.

$\endgroup$
5
  • $\begingroup$ Luigi, what do you think of this idea? Creating a new class that inherits from Bond and takes, as constructor, an array of Bonds and an array of dates. Bond A for example is a fixed rate one, and is valid from issue date to date X. Bond B is a floating rate one and is valid from date X to maturity. The "combined" class will take the cashflows of Bond A from issue date to date X and the cashflows of Bond B from date X to maturity. This way, the "combined" class will be totally generic, and could be used to combine any kind of bonds... $\endgroup$ Nov 27, 2013 at 10:57
  • $\begingroup$ ...I could create a step-up bond by combining two FloatingRateBonds with different spreads. I could create a bond which changes cap or floor at a certain date by combining two FloatingRateBonds with different caps and/or floors. The fixed-to-floater, as we already said, is the combination of a FixedRateBond with a FloatingRateBond, etc. $\endgroup$ Nov 27, 2013 at 11:00
  • 2
    $\begingroup$ That would work, too. Or you could just write a function that takes the same arguments and returns a vector of cashflows that can be passed to the existing Bond constructor. $\endgroup$ Dec 2, 2013 at 9:07
  • $\begingroup$ @LuigiBallabio Don't you think it would be easier to just create one fixed schedule and one floating schedule and then group them into ql.bond ? ql.Bond(0, self.calendar, self.settlement_date,[fixed_leg + floating_leg],ql.Following) $\endgroup$
    – TourEiffel
    May 31 at 14:33
  • $\begingroup$ Yes, that would work, too. $\endgroup$ May 31 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.