irCurveBuilder.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_SWAPCURVEBUILDER_HPP
2 #define JULIAN_SWAPCURVEBUILDER_HPP
3 
9 #include <string>
10 #include <utils/smartPointer.hpp>
11 
12 
13 
14 namespace julian {
15 namespace ir {
16 
37  class BuildCurve {
38  public:
39  BuildCurve();
40 
41  BuildCurve& asOfDate(const Date&);
43  BuildCurve& withDates(const std::vector<Date>&);
44  BuildCurve& withTenors(const std::vector<Tenor>&);
45  BuildCurve& withTenors(const std::vector<std::string>&);
46 
47  BuildCurve& withDiscountFactors(const std::vector<double>&);
48  BuildCurve& withZeroCouponRate(const double);
49  BuildCurve& withZeroCouponRates(const std::vector<double>&);
50  BuildCurve& withForwardRates(const std::vector<double>&);
52 
55 
60 
61  BuildCurve& withFxSpot(const double&);
62 
63  operator InterpolatedCurve();
64  operator FlatCurve();
65 
66  private:
69  enum class InputType {NONE, DF, ZCR, FWD, INSTRUMENTS};
70 
71  std::vector<Date> dates_;
72  std::vector<Tenor> tenors_;
73  std::vector<double> double_holder_;
75  std::vector<SmartPointer<BuildingBlock> > instruments_;
88  double fx_spot_;
91  // bool discounting_curve_given;/*!< @brief true if discounting curve was provided*/
92  // bool projection_curve_given;/*!< @brief true if projection curve provided*/
93  };
94 } // namespace ir
95 } // namespace julian
96 #endif
BuildCurve & withExtrapolator(const SmartPointer< Extrapolator > &)
sets extrapolator
Definition: irCurveBuilder.cpp:134
BuildCurve & withCalendar(const Calendar &)
sets calendar
Definition: irCurveBuilder.cpp:38
InputType method_of_construction_
contains information what method was used to construct curve
Definition: irCurveBuilder.hpp:90
File contains template of deep-coping smart pointer.
File containing definition of interest rates curve building block.
BuildCurve()
constructor
Definition: irCurveBuilder.cpp:18
SmartPointer< Extrapolator > extrapolator_
extrapolator used by interpolated rate curve
Definition: irCurveBuilder.hpp:79
InputType
Auxiliary type used to identify what data are used to create curve.
Definition: irCurveBuilder.hpp:69
BuildCurve & asOfDate(const Date &)
sets date of curve
Definition: irCurveBuilder.cpp:52
std::vector< double > double_holder_
vector holding the doubles which may represent DFs, ZCRs or Fwds
Definition: irCurveBuilder.hpp:73
BuildCurve & usingEstimator(const SmartPointer< Estimator > &)
sets estimator
Definition: irCurveBuilder.cpp:161
Definition: cadHoliday.cpp:3
BuildCurve & withInterpolator(const SmartPointer< Interpolator > &)
sets interpolator
Definition: irCurveBuilder.cpp:127
Class implements calendar object.
Definition: calendar.hpp:30
std::vector< Tenor > tenors_
tenors that can be used to calculate grid dates
Definition: irCurveBuilder.hpp:72
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
File contains interface of algorithms that performs interest rate curve estimations.
BuildCurve & usingProjectionCurve(const SmartPointer< ir::Curve > &)
sets projection curve used in multiple curve framework
Definition: irCurveBuilder.cpp:120
Class implements Builder design pattern that can be used to create interest rate curves.
Definition: irCurveBuilder.hpp:37
BuildCurve & withZeroCouponRates(const std::vector< double > &)
sets zero coupon rates
Definition: irCurveBuilder.cpp:67
File contains definition of swap interpolated curve class.
The object models the interest rate curve.
Definition: interpolatedCurve.hpp:42
File contains definition of flat interest rate curve.
BuildCurve & withForwardRates(const std::vector< double > &)
sets forward rates
Definition: irCurveBuilder.cpp:75
SmartPointer< ir::Curve > projection_curve_
projection curve used in multiple curve framework
Definition: irCurveBuilder.hpp:85
std::vector< SmartPointer< BuildingBlock > > instruments_
benchmark instrument that are used to estimate curve
Definition: irCurveBuilder.hpp:75
BuildCurve & withSetOfInstruments(const std::vector< SmartPointer< BuildingBlock > > &)
sets benchmark instruments
Definition: irCurveBuilder.cpp:148
Calendar calendar_
calendar used by interest rate curve
Definition: irCurveBuilder.hpp:82
Class implements a date object.
Definition: date.hpp:27
std::vector< Date > dates_
dates that can be used as grid dates of interpolated interest rate curve
Definition: irCurveBuilder.hpp:71
The class defines the flat interest rate curve.
Definition: flatCurve.hpp:24
BuildCurve & withDiscountFactors(const std::vector< double > &)
sets discount factors
Definition: irCurveBuilder.cpp:59
SmartPointer< Estimator > estimator_
estimator used to estimate curve basing on the instruments
Definition: irCurveBuilder.hpp:80
BuildCurve & withTenors(const std::vector< Tenor > &)
sets tenors, basing on tenors the grid dates of the curve are calculated
Definition: irCurveBuilder.cpp:97
double fx_spot_
fx spot used by when constructing cross currency curve
Definition: irCurveBuilder.hpp:88
InterestRate rate_
convention of interest rate compounding
Definition: irCurveBuilder.hpp:77
SmartPointer< Interpolator > interpolator_
interpolator used by interpolated rate curve
Definition: irCurveBuilder.hpp:78
SmartPointer< ir::Curve > discounting_curve_
discounting curve used in multiple curve framework
Definition: irCurveBuilder.hpp:84
BuildCurve & withFxSpot(const double &)
sets fx spot
Definition: irCurveBuilder.cpp:141
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
double zero_coupon_rate_
zero coupon rate required by flat curve
Definition: irCurveBuilder.hpp:74
BuildCurve & withInterestRate(const InterestRate &)
sets interest rate convention
Definition: irCurveBuilder.cpp:45
BuildCurve & withDates(const std::vector< Date > &)
sets grid dates of the curve
Definition: irCurveBuilder.cpp:90
Financial instruments module.
BuildCurve & usingDiscountingCurve(const SmartPointer< ir::Curve > &)
sets discounting curve used in multiple curve framework
Definition: irCurveBuilder.cpp:113
BuildCurve & withZeroCouponRate(const double)
sets zero coupon rate
Definition: irCurveBuilder.cpp:83
Date today_
date of interest rate curve
Definition: irCurveBuilder.hpp:87