FRA.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_FRA_HPP
2 #define JULIAN_FRA_HPP
3 
6 #include <utils/utils.hpp>
9 
10 namespace julian {
11 
27  class FRA: public LinearInstrument, public ir::BuildingBlock {
28  public:
29  FRA(){};
30  FRA(Date trade_date, Date fixing_date, Date value_date, Date maturity_date, InterestRate rate, double notional, double fixing, double quoting);
31 
35 
36  double price(const SmartPointer<ir::Curve>&) override;
37  double price(const SmartPointer<ir::Curve>& discounting, const SmartPointer<ir::Curve>& projecting,
38  const SmartPointer<ir::Curve>& , const SmartPointer<ir::Curve>& ) override;
39  void valuation(const SmartPointer<ir::Curve>&) override;
40  void valuation(const SmartPointer<ir::Curve>& discounting1, const SmartPointer<ir::Curve>& discounting2,
41  const SmartPointer<ir::Curve>& projecting1, const SmartPointer<ir::Curve>& projecting2) override;
43 
47  Date getDate() const override;
48  std::pair<CashFlowVector,CashFlowVector> getCFs() const override;
49  double calibrate(const SmartPointer<ir::Curve>& calibrated) override;
50  double calibrate(const SmartPointer<ir::Curve>& discounting, const SmartPointer<ir::Curve>& projection ,const SmartPointer<ir::Curve>& calibrated) override;
51  double getParRate(const SmartPointer<ir::Curve>& discounting ,const SmartPointer<ir::Curve>& projection,const SmartPointer<ir::Curve>& projection2) override;
52  double getQuoting() override;
53  void changeQuoting(double) override;
54  InterestRate getInterestRate() const override;
55  std::string info() const override;
57 
58  FRA* clone() const;
59  ~FRA(){};
60 
61  friend std::ostream& operator<<(std::ostream&,FRA&);
62 
63  private:
70  double notional_;
71  double fixing_;
72  double quote_;
76  };
77 }
78 #endif
File contains types common to all financial instruments.
Class is an abstract class expressing the concept of linear instruments like deposits, FRAs, futures, fxForwards and swaps.
Definition: linearInstrument.hpp:21
File containing definition of interest rates curve building block.
double calibrate(const SmartPointer< ir::Curve > &calibrated) override
Method calibrate is used by root finding estimator.
Definition: FRA.cpp:31
std::pair< CashFlowVector, CashFlowVector > getCFs() const override
Returns the sets of cashflows associated with FRA.
Definition: FRA.cpp:147
double getQuoting() override
Returns quoting.
Definition: FRA.cpp:132
Date fixing_date_
The date on which reference rate is determined.
Definition: FRA.hpp:65
FRA * clone() const
Virtual copy constructor.
Definition: FRA.cpp:138
InterestRate getInterestRate() const override
Returns interest rates convention of the benchmark instruments.
Definition: FRA.cpp:160
void changeQuoting(double) override
changes quoting of the FRA
Definition: FRA.cpp:21
Date trade_date_
The date on which FRA is dealt.
Definition: FRA.hpp:64
Definition: cadHoliday.cpp:3
Date value_date_
The date on which the deposit of found becomes effective.
Definition: FRA.hpp:66
double notional_
The amount for which FRA is traded.
Definition: FRA.hpp:70
Class helps to handle the vector of CFs.
Definition: CashFlowVector.hpp:22
File contains small programming tools.
Building Block is a class that defines the interface for benchmark instruments used for estimating in...
Definition: curveBuildingBlock.hpp:27
Date maturity_date_
The date on which the deposit expires.
Definition: FRA.hpp:67
CashFlowVector fixed_leg_
Fixed cash flow.
Definition: FRA.hpp:75
Class implements a Forward Rate Agreement.
Definition: FRA.hpp:27
Date getDate() const override
returns maturity of FRA
Definition: FRA.cpp:77
friend std::ostream & operator<<(std::ostream &, FRA &)
Overloads stream operator.
Definition: FRA.cpp:92
double quote_
Interest rate at which FRA is traded.
Definition: FRA.hpp:72
File contains definition of linear instruments interface.
std::string info() const override
Returns a name of instrument: FRA.
Definition: FRA.cpp:84
void valuation(const SmartPointer< ir::Curve > &) override
prints price and CFs of FRA using the same curve for discounting and projecting forward rates ...
Definition: FRA.cpp:118
Class implements a date object.
Definition: date.hpp:27
InterestRate rate_
Convention of interest rates.
Definition: FRA.hpp:69
CashFlowVector floating_leg_
Cash flow dependent on market index.
Definition: FRA.hpp:74
double getParRate(const SmartPointer< ir::Curve > &discounting, const SmartPointer< ir::Curve > &projection, const SmartPointer< ir::Curve > &projection2) override
Implies quoting of benchmark instrument from interest rate curves provided.
Definition: FRA.cpp:126
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
double fixing_
Determined fixing.
Definition: FRA.hpp:71
double price(const SmartPointer< ir::Curve > &) override
calculates price of FRA by summing the discounted CFs of fixed and floating leg
Definition: FRA.cpp:70
File contains definition of InterestRate class.