Calculates option's delta. More...

#include <optionDelta.hpp>

Inheritance diagram for julian::OptionDelta:
julian::OptionGreeksDecorator julian::OptionGreeks

Public Member Functions

 OptionDelta (SmartPointer< OptionGreeks > input, double h, NumDiffScheme scheme, std::string risk_name="Delta")
 Constructor. More...
 
GreeksIntermediateResults calculateRisks (const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates the option's delta. More...
 
std::map< std::string, double > getRisks (const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 returns the PV and Greek parameter More...
 
OptionDeltaclone () const
 Virtual copy constructor. More...
 
- Public Member Functions inherited from julian::OptionGreeksDecorator
 OptionGreeksDecorator (SmartPointer< OptionGreeks > risks)
 Constructor. More...
 
OptionGreeksDecoratorclone () const
 Virtual copy constructor. More...
 
- Public Member Functions inherited from julian::OptionGreeks
virtual ~OptionGreeks ()
 Destructor. More...
 

Private Member Functions

void CntrDelta (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates delta using central differencing scheme. More...
 
void FwdDelta (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates delta using forward differencing scheme. More...
 
void BwdDelta (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates delta using backward differencing scheme. More...
 

Private Attributes

double h_
 Increment used in differencing scheme. More...
 
NumDiffScheme scheme_
 Scheme used in differencing. More...
 
std::string risk_name_
 Risk name that will be used as key for result map. Default name is Delta. More...
 

Detailed Description

Calculates option's delta.

This method calculates Delta. Using the method prize of julian::PricingEngine and bumpSpot of julian::MarketModel it calculates the option sensitivity to asset prize change. Delta of option is calculated using following finite difference scheme:

  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot+h) - PV(Spot)}{h}$ when forward differencing is used
  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot) - PV(Spot-h)}{h}$ when backward differencing is used
  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot+h) - PV(Spot-h)}{2h}$ when central differencing is used The result is saved in map. OptionDelta is a concrete decorator in decorator structure. Concrete Decorator is a class that altered alters the behaviour of Concrete Component.

Constructor & Destructor Documentation

julian::OptionDelta::OptionDelta ( SmartPointer< OptionGreeks input,
double  h,
NumDiffScheme  scheme,
std::string  risk_name = "Delta" 
)
inline

Constructor.

Member Function Documentation

void julian::OptionDelta::BwdDelta ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates delta using backward differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Delta. If they were not calculated, it performs calculations, saves them and then calculates Delta.

GreeksIntermediateResults julian::OptionDelta::calculateRisks ( const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
virtual

Calculates the option's delta.

Delta of option is calculated using the finite difference scheme

  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot+h) - PV(Spot)}{h}$ when forward differencing is used
  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot) - PV(Spot-h)}{h}$ when backward differencing is used
  • $Delta = \frac{\partial PV}{\partial Spot} \approx \frac{PV(Spot+h) - PV(Spot-h)}{2h}$ when central differencing is used

Reimplemented from julian::OptionGreeksDecorator.

OptionDelta * julian::OptionDelta::clone ( ) const
virtual

Virtual copy constructor.

Reimplemented from julian::OptionGreeks.

void julian::OptionDelta::CntrDelta ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates delta using central differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Delta. If they were not calculated, it performs calculations, saves them and then calculates Delta.

void julian::OptionDelta::FwdDelta ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates delta using forward differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Delta. If they were not calculated, it performs calculations, saves them and then calculates Delta.

std::map< std::string, double > julian::OptionDelta::getRisks ( const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
virtual

returns the PV and Greek parameter

Returns
method returns map with name of Greeks as key and the value of Greeks as value

Reimplemented from julian::OptionGreeksDecorator.

Member Data Documentation

double julian::OptionDelta::h_
private

Increment used in differencing scheme.

std::string julian::OptionDelta::risk_name_
private

Risk name that will be used as key for result map. Default name is Delta.

NumDiffScheme julian::OptionDelta::scheme_
private

Scheme used in differencing.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/pricingEngines/optionGreeks/optionDelta.hpp
  • C:/Unix/home/OEM/jULIAN/src/pricingEngines/optionGreeks/optionDelta.cpp