Calculates option's Volga. More...

#include <optionVolga.hpp>

Inheritance diagram for julian::OptionVolga:
julian::OptionGreeksDecorator julian::OptionGreeks

Public Member Functions

 OptionVolga (SmartPointer< OptionGreeks > input, double h, NumDiffScheme scheme, std::string risk_name="Volga")
 Constructor. 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...
 
GreeksIntermediateResults calculateRisks (const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates the option's Volga. More...
 
OptionVolgaclone () const
 Virtual copy constructor. More...
 
- Public Member Functions inherited from julian::OptionGreeksDecorator
 OptionGreeksDecorator (SmartPointer< OptionGreeks > risks)
 Constructor. More...
 
- Public Member Functions inherited from julian::OptionGreeks
virtual ~OptionGreeks ()
 Destructor. More...
 

Private Member Functions

void CntrVolga (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Volga using central scheme. More...
 
void FwdVolga (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Volga using forward differencing scheme. More...
 
void BwdVolga (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Volga using backward differencing scheme. More...
 

Private Attributes

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

Detailed Description

Calculates option's Volga.

This method calculates Volga. Using the method prize of julian::PricingEngine and bumpVolatility/bumpSpot of julian::MarketModel it calculates the cross-derivative of option prize wrt to spot and volatility.

Volga of option is calculated using the finite difference scheme

  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol+2h) - 2PV(Vol+h) + PV(Vol)}{h^2}$ when forward scheme is used,
  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol) - 2PV(Vol-h) + PV(Vol-2h)}{h^2}$ when backward scheme is used,
  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol+h) - 2PV(Vol) + PV(Vol-h)}{h^2}$ when central scheme is used.

The result is saved in map. OptionVolga is a concrete decorator in decorator structure. Concrete Decorator is a class that altered alters the behaviour of Concrete Component.

Constructor & Destructor Documentation

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

Constructor.

Member Function Documentation

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

Calculates Volga using backward differencing scheme.

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

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

Calculates the option's Volga.

Volga of option is calculated using the finite difference scheme

  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol+2h) - 2PV(Vol+h) + PV(Vol)}{h^2}$ when forward scheme is used,
  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol) - 2PV(Vol-h) + PV(Vol-2h)}{h^2}$ when backward scheme is used,
  • $Volga = \frac{\partial^2 PV}{\partial Vol^2} \approx \frac{PV(Vol+h) - 2PV(Vol) + PV(Vol-h)}{h^2}$ when central scheme is used.

Reimplemented from julian::OptionGreeksDecorator.

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

Virtual copy constructor.

Reimplemented from julian::OptionGreeksDecorator.

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

Calculates Volga using central scheme.

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

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

Calculates Volga using forward differencing scheme.

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

std::map< std::string, double > julian::OptionVolga::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::OptionVolga::h_
private

Increment used in differencing scheme for volatility direction.

std::string julian::OptionVolga::risk_name_
private

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

NumDiffScheme julian::OptionVolga::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/optionVolga.hpp
  • C:/Unix/home/OEM/jULIAN/src/pricingEngines/optionGreeks/optionVolga.cpp