europeanOpt.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_EUROPEANOPT_HPP
2 #define JULIAN_EUROPEANOPT_HPP
3 
5 
6 namespace julian {
22  class EuropeanOpt: public Option {
23  public:
29  EuropeanOpt(Date trade_date, Date start_date, Date expiry_date, Date delivery_date ,
30  double notional, double strike, CallPut icp);
31 
32  double prizeAnalytically(const SmartPointer<MarketModel>&) const override;
33  double prizePaths(std::vector<Path>,double) const override;
34 
35  Date getExpiry() const override;
36  Date getMaturity() const override;
37  double getStrike() const override;
38 
39  void recordFixing(Date,double) override;
40 
41  CallPut getType() const;
42  double payoff(double) const override;
43 
44  std::tuple<Date,Date,double,double,CallPut> getSettings() const;
45 
46  virtual EuropeanOpt* clone() const override;
47 
50  virtual ~EuropeanOpt(){};
51 
52  friend std::ostream& operator<<(std::ostream&, EuropeanOpt&);
53  friend class boost::serialization::access;
54  private:
60  double notional_;
61  double strike_;
66  template<class Archive>
67  void serialize(Archive & ar, const unsigned int){
68  boost::serialization::base_object<Option>(*this);
69  ar & BOOST_SERIALIZATION_NVP(trade_date_);
70  ar & BOOST_SERIALIZATION_NVP(start_date_);
71  ar & BOOST_SERIALIZATION_NVP(expiry_date_);
72  ar & BOOST_SERIALIZATION_NVP(delivery_date_);
73 
74  ar & BOOST_SERIALIZATION_NVP(notional_);
75  ar & BOOST_SERIALIZATION_NVP(strike_);
76  ar & BOOST_SERIALIZATION_NVP(icp_);
77  }
78 
79  };
80 } // julian
81 #endif
double strike_
options strike
Definition: europeanOpt.hpp:61
double notional_
notional of trade
Definition: europeanOpt.hpp:60
friend std::ostream & operator<<(std::ostream &, EuropeanOpt &)
Overloads stream operator.
Definition: europeanOpt.cpp:98
Definition: cadHoliday.cpp:3
CallPut
Enumeration defining option types.
Definition: instrumentAuxiliaryTypes.hpp:16
double payoff(double) const override
Calculates payoff at expiry.
Definition: europeanOpt.cpp:22
double prizeAnalytically(const SmartPointer< MarketModel > &) const override
calculates the price of option using market model provided
Definition: europeanOpt.cpp:90
Date delivery_date_
Date when option is settled.
Definition: europeanOpt.hpp:58
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
Date getExpiry() const override
returns expiry date
Definition: europeanOpt.cpp:45
std::tuple< Date, Date, double, double, CallPut > getSettings() const
returns the tuple of option&#39;s parameters
Definition: europeanOpt.cpp:78
double prizePaths(std::vector< Path >, double) const override
calculates the option value basing on the paths provided by Monte Carlo Pricer
Definition: europeanOpt.cpp:34
File contains definition of financial option interface.
double getStrike() const override
returns strike
Definition: europeanOpt.cpp:58
Date getMaturity() const override
returns maturity date
Definition: europeanOpt.cpp:51
CallPut icp_
options type
Definition: europeanOpt.hpp:62
Class is an abstract interface for single asset financial options.
Definition: option.hpp:22
Class implements Plain Vanilla European Option.
Definition: europeanOpt.hpp:22
EuropeanOpt()
default constructor
Definition: europeanOpt.hpp:26
Class implements a date object.
Definition: date.hpp:27
Date expiry_date_
Date of establishing the pay off amount.
Definition: europeanOpt.hpp:57
virtual EuropeanOpt * clone() const override
Virtual copy constructor.
Definition: europeanOpt.cpp:84
Date start_date_
date on which payoff is discounted
Definition: europeanOpt.hpp:56
void serialize(Archive &ar, const unsigned int)
interface used by Boost serialization library
Definition: europeanOpt.hpp:67
CallPut getType() const
returns option type
Definition: europeanOpt.cpp:65
void recordFixing(Date, double) override
Empty method.
Definition: europeanOpt.cpp:71
Date trade_date_
date of trade
Definition: europeanOpt.hpp:55
virtual ~EuropeanOpt()
destructor
Definition: europeanOpt.hpp:50