Posted by
Joseph Wang on
May 08, 2005; 1:58pm
URL: http://quantlib.414.s1.nabble.com/Re-convertible-bond-class-and-finite-differencing-tp3768.html
[hidden email] wrote:
> Hi luigi,
>
> Many thanks for your comments. Perhaps BondParams is not a good name
> but all these parameters or inputs are required for calculating PV for
> most fixed income instruments e.g. swaps and bonds.
Maybe we ought to have Bond inherit something else.
FixedIncomeSecurity? One problem with the Bond class is that there
seems to be a lot of calculation in there which seems to go against the
framework of separating pricing from the instruments.
>
> How about this?
>
>
> We could have them in a struct say
>
> struct CashFlowSchedule{
> public:
> const Date& issueDate,
> const Date& datedDate,
> const Date& MaturityDate,
> Integer settlementDays,
> Rate coupon,
> Frequency couponFrequency,
> const DayCounter& couponFrequency,
> const Calendar& calendar,
> BusinessDayConvention convention,
> Real redemption)
> }
>
>
> We may have to rewrite fixedcoupon bond to use this struct.
>
>
> Struct Price{
> enum Type { Dirty, Clean};
> Real price;
> Type type;
> };
>
> Struct Callability{
> enum Type { Call, Put};
> Price price;
> Type type;
> Date date;
> };
>
> typedef vector<Callability> CallabilitySchedule;
>
> Struct Dividend{
> enum Type { Cash, Yield};
> Real amount;
> Type type;
> Date date;
> };
>
> typedef vector<Dividend> DividendSchedule;
>
> Class ConvertibleBond: public FixedCouponBond {
> public:
> ConvertibleBond(
> const boost::shared_ptr<stochasticProcess>& stochProc,
> Real conversionRatio,
> const DividendSchedule& dividends,
> const CallabilitySchedule& callability,
> const Handle<Quote>& creditSpread,
> const CashFlowSchedule& cashflow,
> ); // constructor
> virtual ~ConvertibleBond();
> Real conversionRatio() const;
> DividendSchedule dividends() const;
> CallabilitySchedule callability() const;
> Handle<Quote>& creditSpread() const;
> private:
> Real conversionRatio_;
> Spread creditSpreadRates_;
> CallabilitySchedule callability_;
> DividendSchedule dividends_;
> Handle<Quote> creditSpread_;
> };
>
> Lets have some feedback on this?
>
>
I think you are on the right track, but a convertible bond doesn't
necessarily have to be a fixed coupon bond. My inclination is to have
convertible bond use aggregation rather than inheritance. The class
structure would be exactly like the one you had before, except that it
would have Bond as a member rather than a superclass.
I'd like to get something checked into the tree in the next week or so.
We don't have to have all of the elements of a convertible bond ready,
but I think we are close enough to a structure that we can start working
off of.
FYI, I've been doing some work on the finite difference pricing engines
to make them less dependent on vanilla options. A lot of the work is
replacing subclassing with aggregation so that the engines will
eventually work with the convertible bond class.
> Regards
>
> Theo