BlackScholesModel.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_BLACKSCHOLESMODEL_HPP
2 #define JULIAN_BLACKSCHOLESMODEL_HPP
3 
8 #include <dates/date.hpp>
10 
11 
12 namespace julian {
13 
36  class BlackScholesModel: public DeeplyCopyableMarketModel<BlackScholesModel> {
37  public:
43  BlackScholesModel(const Date& date, const double& asset_prize,
44  const SmartPointer<ir::Curve>& discounting_curve,
45  const SmartPointer<ir::Curve>& dividend_curve,
46  const SmartPointer<Volatility>& volatility):
47  date_(date), asset_prize_(asset_prize), discounting_curve_(discounting_curve),
48  dividend_curve_(dividend_curve), volatility_(volatility) {};
49 
50  virtual Date getDate() const override;
51  virtual double getAssetPrize() const override;
52  virtual SmartPointer<ir::Curve> getDiscountingCurve() const override;
53  virtual SmartPointer<ir::Curve> getDividendCurve() const override;
54 
55  virtual void setDate(Date&) override;
56  virtual void setAssetPrize(double) override;
57  virtual void bumpAssetPrize(double) override;
58  virtual void bumpVolatility(double) override;
59 
60  double prizeAnalytically(const EuropeanOpt&) const override;
61 
62  virtual ~BlackScholesModel(){};
63 
64  private:
65  Date date_;
66  double asset_prize_;
71  double calculateDrift(Date) const;
72  };
73 }
74 
75 #endif /* BLACKSCHOLESMODEL_HPP */
double prizeAnalytically(const EuropeanOpt &) const override
method calculates the prize of European vanilla option
Definition: BlackScholesModel.cpp:96
double asset_prize_
Underlying asset prize.
Definition: BlackScholesModel.hpp:66
Definition: cadHoliday.cpp:3
Date date_
Market date.
Definition: BlackScholesModel.hpp:62
SmartPointer< ir::Curve > dividend_curve_
Curve used to estimate continuous dividend.
Definition: BlackScholesModel.hpp:68
SmartPointer< Volatility > volatility_
Volatility of the asset prize.
Definition: BlackScholesModel.hpp:69
BlackScholesModel()
Default Constructor.
Definition: BlackScholesModel.hpp:40
double calculateDrift(Date) const
basing on discounting and dividend curve exponential drift is calculated
Definition: BlackScholesModel.cpp:71
BlackScholesModel(const Date &date, const double &asset_prize, const SmartPointer< ir::Curve > &discounting_curve, const SmartPointer< ir::Curve > &dividend_curve, const SmartPointer< Volatility > &volatility)
Constructor.
Definition: BlackScholesModel.hpp:43
File contains definition of date class.
Class uses Curiously Recurring Template Pattern to implement polymorphic copy construction in every d...
Definition: marketModel.hpp:91
virtual void setAssetPrize(double) override
sets asset prize
Definition: BlackScholesModel.cpp:47
virtual void setDate(Date &) override
sets the market date
Definition: BlackScholesModel.cpp:39
File contains interface for volatility surface.
virtual void bumpAssetPrize(double) override
bump asset prize additively
Definition: BlackScholesModel.cpp:55
virtual void bumpVolatility(double) override
bump volatility additively
Definition: BlackScholesModel.cpp:64
virtual SmartPointer< ir::Curve > getDiscountingCurve() const override
returns discounting curve
Definition: BlackScholesModel.cpp:25
virtual SmartPointer< ir::Curve > getDividendCurve() const override
returns dividend curve
Definition: BlackScholesModel.cpp:31
File contains definition of forward curve class.
SmartPointer< ir::Curve > discounting_curve_
Curve used to discount CFs.
Definition: BlackScholesModel.hpp:67
virtual double getAssetPrize() const override
returns the prize of asset
Definition: BlackScholesModel.cpp:19
Class implements Plain Vanilla European Option.
Definition: europeanOpt.hpp:22
Class implements a date object.
Definition: date.hpp:27
Class implements Black Scholes model.
Definition: BlackScholesModel.hpp:36
File contains implementation of interface for market models.
virtual Date getDate() const override
returns the date on which market data are actual
Definition: BlackScholesModel.cpp:13
File contains function EasterForAGivenYear.
File contains interface of interest rate curves.