optionDelta.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_OPTIONDELTA_HPP
2 #define JULIAN_OPTIONDELTA_HPP
3 
6 
7 namespace julian {
24  public:
27  OptionDelta(SmartPointer<OptionGreeks> input, double h, NumDiffScheme scheme, std::string risk_name = "Delta"):
28  OptionGreeksDecorator(input), h_(h), scheme_(scheme), risk_name_(risk_name) {}
29 
31  const SmartPointer<PricingEngine>& prizer,
32  const SmartPointer<Option>& option);
33 
34  std::map<std::string,double> getRisks(const SmartPointer<MarketModel>& model,
35  const SmartPointer<PricingEngine>& prizer,
36  const SmartPointer<Option>& option);
37  OptionDelta* clone() const;
38 
39  ~OptionDelta(){};
40  private:
42  const SmartPointer<MarketModel>& model,
43  const SmartPointer<PricingEngine>& prizer,
44  const SmartPointer<Option>& option);
46  const SmartPointer<MarketModel>& model,
47  const SmartPointer<PricingEngine>& prizer,
48  const SmartPointer<Option>& option);
50  const SmartPointer<MarketModel>& model,
51  const SmartPointer<PricingEngine>& prizer,
52  const SmartPointer<Option>& option);
53 
54  double h_ ;
56  std::string risk_name_;
57  };
58 } // namespace julian
59 
60 #endif
Definition: cadHoliday.cpp:3
double h_
Increment used in differencing scheme.
Definition: optionDelta.hpp:54
Calculates option&#39;s delta.
Definition: optionDelta.hpp:23
void BwdDelta(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates delta using backward differencing scheme.
Definition: optionDelta.cpp:105
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
OptionDelta * clone() const
Virtual copy constructor.
Definition: optionDelta.cpp:129
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: optionDelta.cpp:35
OptionDelta(SmartPointer< OptionGreeks > input, double h, NumDiffScheme scheme, std::string risk_name="Delta")
Constructor.
Definition: optionDelta.hpp:27
void CntrDelta(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates delta using central differencing scheme.
Definition: optionDelta.cpp:47
Interface of option Greeks decorating classes.
Data structure holding the PV and Greeks.
Definition: optionGreeks.hpp:23
void FwdDelta(GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates delta using forward differencing scheme.
Definition: optionDelta.cpp:78
File contains small mathematical classes and functions.
GreeksIntermediateResults calculateRisks(const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
Calculates the option&#39;s delta.
Definition: optionDelta.cpp:13
NumDiffScheme scheme_
Scheme used in differencing.
Definition: optionDelta.hpp:55
Interface for classes decorating Option Greeks.
Definition: optionGreeksDecorator.hpp:15
std::string risk_name_
Risk name that will be used as key for result map. Default name is Delta.
Definition: optionDelta.hpp:56
NumDiffScheme
collection of enumerations, simple classes and small functions used in mathematical computations ...
Definition: mathUtils.hpp:16