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:
- to extract the clean price from an object of class
FixedRateBond
whoseSchedule
has termination date equal to the "swap" date and whose redemption is equal to zero; - to extract the clean price from an object of class
FloatingRateBond
whose issue date is equal to the "swap" date; - to sum 1 and 2.
Is the above proceeding correct?
Is there any faster way?