optionGamma.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_OPTIONGAMMA_HPP
2 #define JULIAN_OPTIONGAMMA_HPP
3 
6 
7 namespace julian {
26  public:
29  OptionGamma(SmartPointer<OptionGreeks> input, double h, NumDiffScheme scheme, std::string risk_name = "Gamma" ):
30  OptionGreeksDecorator(input), h_(h), scheme_(scheme), risk_name_(risk_name) {}
31 
33  const SmartPointer<PricingEngine>& prizer,
34  const SmartPointer<Option>& option);
35 
36  std::map<std::string,double> getRisks(const SmartPointer<MarketModel>& model,
37  const SmartPointer<PricingEngine>& prizer,
38  const SmartPointer<Option>& option);
39 
40  OptionGamma* clone() const;
41 
42  ~OptionGamma(){};
43  private:
45  const SmartPointer<MarketModel>& model,
46  const SmartPointer<PricingEngine>& prizer,
47  const SmartPointer<Option>& option);
49  const SmartPointer<MarketModel>& model,
50  const SmartPointer<PricingEngine>& prizer,
51  const SmartPointer<Option>& option);
53  const SmartPointer<MarketModel>& model,
54  const SmartPointer<PricingEngine>& prizer,
55  const SmartPointer<Option>& option);
56 
57  double h_;
59  std::string risk_name_;
60  };
61 }
62 #endif
std::string risk_name_
Risk name that will be used as key for result map. Default name is Gamma.
Definition: optionGamma.hpp:59
Definition: cadHoliday.cpp:3
GreeksIntermediateResults calculateRisks(const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates the option&#39;s gamma.
Definition: optionGamma.cpp:13
OptionGamma * clone() const
virtual copy constructor
Definition: optionGamma.cpp:155
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
OptionGamma(SmartPointer< OptionGreeks > input, double h, NumDiffScheme scheme, std::string risk_name="Gamma")
constructor
Definition: optionGamma.hpp:29
NumDiffScheme scheme_
Scheme used in differencing.
Definition: optionGamma.hpp:58
std::map< std::string, double > getRisks(const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Returns the PV and Greek parameter.
Definition: optionGamma.cpp:35
Interface of option Greeks decorating classes.
Data structure holding the PV and Greeks.
Definition: optionGreeks.hpp:23
void BwdGamma(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates gamma using backward differencing scheme.
Definition: optionGamma.cpp:120
File contains small mathematical classes and functions.
void CntrGamma(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates gamma using central differencing scheme.
Definition: optionGamma.cpp:48
Interface for classes decorating Option Greeks.
Definition: optionGreeksDecorator.hpp:15
Calculates option&#39;s gamma.
Definition: optionGamma.hpp:25
double h_
Increment used in differencing scheme.
Definition: optionGamma.hpp:57
void FwdGamma(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates gamma using forward differencing scheme.
Definition: optionGamma.cpp:84
NumDiffScheme
collection of enumerations, simple classes and small functions used in mathematical computations ...
Definition: mathUtils.hpp:16