fixedIncomeBond.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_FIXEDINCOMEBOND_HPP
2 #define JULIAN_FIXEDINCOMEBOND_HPP
3 
7 #include <dates/timeUnit.hpp>
8 
9 namespace julian {
22  class FixedIncomeBond: public Bond {
23  public:
27 
30  FixedIncomeBond(Date issue_date, Date maturity_date, double principal, double coupon, InterestRate rate, CashFlowVector cash_flows, Frequency payment_frequency):
31  issue_date_(issue_date), maturity_date_(maturity_date), principal_(principal), coupon_(coupon), rate_(rate), cash_flows_(cash_flows), payment_frequency_(payment_frequency) {};
35  virtual void valuation(const SmartPointer<ir::Curve>& curve) const override;
36  virtual void valuation(const SmartPointer<ir::Curve>& curve, const SmartPointer<ir::Curve>& ) const override;
37 
38  virtual double prize(const SmartPointer<ir::Curve>& curve) const override;
39  virtual double prize(const SmartPointer<ir::Curve>& curve, const SmartPointer<ir::Curve>& ) const override;
40 
41  virtual double getPrincipal() const override;
42  virtual Date getDate() const override;
43  virtual FixedIncomeBond* clone() const override;
45 
46  double getCoupon() const;
47 
50  virtual ~FixedIncomeBond(){};
51 
52  friend std::ostream& operator<<(std::ostream&, FixedIncomeBond&);
53 
54  private:
57  double principal_;
58  double coupon_;
62  };
63 }
64 
65 #endif
friend std::ostream & operator<<(std::ostream &, FixedIncomeBond &)
Overloads stream operator.
Definition: fixedIncomeBond.cpp:66
virtual FixedIncomeBond * clone() const override
virtual copy constructor
Definition: fixedIncomeBond.cpp:89
double getCoupon() const
returns the coupon
Definition: fixedIncomeBond.cpp:58
virtual Date getDate() const override
returns the bond&#39;s maturity
Definition: fixedIncomeBond.cpp:52
virtual double prize(const SmartPointer< ir::Curve > &curve) const override
prize bond
Definition: fixedIncomeBond.cpp:31
Definition: cadHoliday.cpp:3
virtual void valuation(const SmartPointer< ir::Curve > &curve) const override
bond valuation
Definition: fixedIncomeBond.cpp:11
Date maturity_date_
Date of repaying original sum loaned.
Definition: fixedIncomeBond.hpp:56
FixedIncomeBond()
Default Constructor.
Definition: fixedIncomeBond.hpp:26
virtual ~FixedIncomeBond()
destructor
Definition: fixedIncomeBond.hpp:50
Class helps to handle the vector of CFs.
Definition: CashFlowVector.hpp:22
File contains interface for all bond instruments.
Class implements the bond paying fixed coupon.
Definition: fixedIncomeBond.hpp:22
Class is an abstract class expressing the concept of bonds.
Definition: bond.hpp:20
InterestRate rate_
Interest rate convention.
Definition: fixedIncomeBond.hpp:59
Frequency payment_frequency_
Frequency of coupon payment.
Definition: fixedIncomeBond.hpp:61
CashFlowVector cash_flows_
Cash Flow Vector containing julian::FixedCashFlow.
Definition: fixedIncomeBond.hpp:60
Date issue_date_
Bond&#39;s issue date.
Definition: fixedIncomeBond.hpp:55
Class implements a date object.
Definition: date.hpp:27
virtual double getPrincipal() const override
returns the bond&#39;s principal
Definition: fixedIncomeBond.cpp:46
double coupon_
Coupon paid by bond.
Definition: fixedIncomeBond.hpp:58
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
FixedIncomeBond(Date issue_date, Date maturity_date, double principal, double coupon, InterestRate rate, CashFlowVector cash_flows, Frequency payment_frequency)
Constructor.
Definition: fixedIncomeBond.hpp:30
Frequency
Definition: timeUnit.hpp:68
File contain time units and other useful enumerations.
File contains definition of InterestRate class.
File contains definition of cash flow vector.
double principal_
Principal of bond.
Definition: fixedIncomeBond.hpp:57