option.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_OPTION_HPP
2 #define JULIAN_OPTION_HPP
3 
4 #include <dates/date.hpp>
5 #include <vector>
7 #include <utils/smartPointer.hpp>
10 
11 namespace julian {
12 
22  class Option {
23  public:
26  virtual double payoff(double) const = 0;
27 
30  virtual Date getExpiry() const = 0;
31 
34  virtual Date getMaturity() const = 0;
35 
41  virtual double getStrike() const = 0;
42 
45  virtual void recordFixing(Date,double);
46 
52  virtual double prizePaths(std::vector<Path> path, double df) const = 0;
53 
55 
56 
60 
63  virtual double prizeAnalytically(const SmartPointer<MarketModel>&) const = 0;
65 
68  virtual Option* clone() const = 0;
69 
72  virtual ~Option(){};
73 
74  friend class boost::serialization::access;
75  private:
76 
79  template<class Archive>
80  void serialize(Archive & , const unsigned int) {
81  }
82  };
83 } // namespae julian
84 #endif
File contains types common to all financial instruments.
File contains template of deep-coping smart pointer.
virtual double payoff(double) const =0
Calculates payoff at expiry.
virtual Date getExpiry() const =0
returns expiry date
virtual Option * clone() const =0
Virtual copy constructor.
File contains implementation of Path object.
Definition: cadHoliday.cpp:3
virtual double prizeAnalytically(const SmartPointer< MarketModel > &) const =0
calculates the price of option using market model provided
void serialize(Archive &, const unsigned int)
interface used by Boost serialization library
Definition: option.hpp:80
virtual double prizePaths(std::vector< Path > path, double df) const =0
calculates the option value basing on the paths provided by Monte Carlo Pricer
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
File contains definition of date class.
virtual double getStrike() const =0
returns strike
Class is an abstract interface for single asset financial options.
Definition: option.hpp:22
Class implements a date object.
Definition: date.hpp:27
virtual ~Option()
destructor
Definition: option.hpp:72
virtual void recordFixing(Date, double)
add fixing to option&#39;s schedule
virtual Date getMaturity() const =0
returns maturity date
File contains implementation of interface for market models.