I would like to know what are the issues related to a possible CallableFloatingRateBond
class in QuantLib and to have some hints on implementation.
My (very obvious) idea is to declare such a class like:
class CallableFloatingRateBond : public FloatingRateBond, public CallableBond
{
public:
CallableFloatingRateBond(); //ctor
virtual ~CallableFloatingRateBond(); //dtor
protected:
// ..?..
private:
// ..?..
};
Nevertheless, CallableFixedRateBond
class inherits just from Bond
class through the abstract CallableBond
class, whose purpose seems to be for the most setting up pricing engine and relinkable handles to stuff like Black volatilities and discount curves.
In fact, CallableFixedRateBond
implementation works a lot with PricingEngine::arguments*
to set up cash flows and callability schedule, but this does not involve the issue of an IborIndex
or a SwapIndex
which should be amended along with the short term rate dynamics (e.g. an HullWhite
short rate model discretized by a TreeCallableFixedRateBondEngine
).
A different, raw, solution could be to:
- set up a
FloatingRateBond
with itsCouponPricer
; - extract cash flows from this FRN and possible optionlets' prices;
- set
CallableFixedRateBond
cash flows equal to the ones extracted from above; - price a
CallableFixedRateBond
by using the default implementation; - sum optionlet's prices (if any) to 4.
A "dirty" class like this one could make the job of returning something like an OAS to the user just by shifting up IborIndex
's / SwapIndex
's term structure and HullWhite
's term structure all together, but I am really wondering whether this is theoretically consistent.