floatingRateBond.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_FLOATINGRATEBOND_HPP
2 #define JULIAN_FLOATINGRATEBOND_HPP
3 
7 #include <dates/timeUnit.hpp>
8 
9 namespace julian {
22  class FloatingRateBond: public Bond {
23  public:
24 
28 
31  FloatingRateBond(Date issue_date, Date maturity_date, double principal, double margin,
32  InterestRate rate, CashFlowVector cash_flows, Frequency payment_frequency):
33  issue_date_(issue_date), maturity_date_(maturity_date), principal_(principal), margin_(margin),
34  rate_(rate), cash_flows_(cash_flows), payment_frequency_(payment_frequency) {}
35 
39  virtual void valuation(const SmartPointer<ir::Curve>& curve) const override;
40  virtual void valuation(const SmartPointer<ir::Curve>& discounting_curve,
41  const SmartPointer<ir::Curve>& projection_curve) const override;
42 
43  virtual double prize(const SmartPointer<ir::Curve>& curve) const override;
44  virtual double prize(const SmartPointer<ir::Curve>& curve,
45  const SmartPointer<ir::Curve>& ) const override;
46  virtual double getPrincipal() const override;
47  virtual Date getDate() const override;
48  virtual FloatingRateBond* clone() const;
50 
53  virtual ~FloatingRateBond(){};
54 
55  friend std::ostream& operator<<(std::ostream&, FloatingRateBond&);
56 
57  private:
60  double principal_;
61  double margin_;
65  };
66 }
67 
68 #endif
virtual double prize(const SmartPointer< ir::Curve > &curve) const override
prize bond
Definition: floatingRateBond.cpp:37
virtual void valuation(const SmartPointer< ir::Curve > &curve) const override
bond valuation
Definition: floatingRateBond.cpp:12
FloatingRateBond()
Default Constructor.
Definition: floatingRateBond.hpp:27
InterestRate rate_
Interest rate convention.
Definition: floatingRateBond.hpp:62
CashFlowVector cash_flows_
Cash Flow Vector containing julian::FloatingCashFlow.
Definition: floatingRateBond.hpp:63
Definition: cadHoliday.cpp:3
FloatingRateBond(Date issue_date, Date maturity_date, double principal, double margin, InterestRate rate, CashFlowVector cash_flows, Frequency payment_frequency)
Constructor.
Definition: floatingRateBond.hpp:31
Date maturity_date_
Date of repaying original sum loaned.
Definition: floatingRateBond.hpp:59
Class helps to handle the vector of CFs.
Definition: CashFlowVector.hpp:22
Frequency payment_frequency_
Frequency of coupon payment.
Definition: floatingRateBond.hpp:64
File contains interface for all bond instruments.
friend std::ostream & operator<<(std::ostream &, FloatingRateBond &)
Overloads stream operator.
Definition: floatingRateBond.cpp:71
double principal_
Principal of bond.
Definition: floatingRateBond.hpp:60
double margin_
Margin added to cash flows.
Definition: floatingRateBond.hpp:61
Class implements the bond paying floating coupon.
Definition: floatingRateBond.hpp:22
virtual Date getDate() const override
returns the bond&#39;s maturity
Definition: floatingRateBond.cpp:63
Class is an abstract class expressing the concept of bonds.
Definition: bond.hpp:20
virtual FloatingRateBond * clone() const
virtual copy constructor
Definition: floatingRateBond.cpp:95
virtual ~FloatingRateBond()
deconstructor
Definition: floatingRateBond.hpp:53
Class implements a date object.
Definition: date.hpp:27
virtual double getPrincipal() const override
returns the bond&#39;s principal
Definition: floatingRateBond.cpp:57
Date issue_date_
Bond&#39;s issue date.
Definition: floatingRateBond.hpp:58
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
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.