#ifndef _ANALYTIC_BOND_HPP_ #define _ANALYTIC_BOND_HPP_ #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_GLOBALDATA_HPP_ #include #endif #ifndef _ANALYTIC_INSTRUMENT_HPP_ #include #endif #ifndef _ANALYTIC_RATE_HPP_ #include #endif class Bond : public Instrument { public: Bond(void); Bond(const Bond &bond); Bond(double par,const Coupon &coupon,int ytm,double price=0.00); virtual ~Bond(); Bond &operator=(const Bond &bond); BOOL operator==(const Bond &bond)const; double par(void)const; void par(double par); int ytm(void)const; void ytm(int ytm); const Rate &yield(void)const; void yield(const Rate &yield); virtual BOOL cashflows(GlobalData &cashflows); // retrieve cashflows (ie)periodic payments virtual double discount(Rate yield); // given the yield, calculate the price virtual Rate discount(double price); // given the price, calculate the yield private: double mPar; Rate mYield; int mYTM; }; #endif