QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AnalyticCompoundOptionEngine Class Reference

Pricing engine for compound options using analytical formulae. More...

#include <analyticcompoundoptionengine.hpp>

+ Inheritance diagram for AnalyticCompoundOptionEngine:
+ Collaboration diagram for AnalyticCompoundOptionEngine:

Public Member Functions

 AnalyticCompoundOptionEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process)
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< CompoundOption::arguments, CompoundOption::results >
PricingEngine::argumentsgetArguments () const override
 
const PricingEngine::resultsgetResults () const override
 
void reset () override
 
void update () override
 
- Public Member Functions inherited from PricingEngine
 ~PricingEngine () override=default
 
virtual argumentsgetArguments () const =0
 
virtual const resultsgetResults () const =0
 
virtual void reset ()=0
 
virtual void calculate () const =0
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Private Member Functions

Time residualTimeMother () const
 
Time residualTimeDaughter () const
 
Time residualTimeMotherDaughter () const
 
Date maturityMother () const
 
Date maturityDaughter () const
 
Real dPlus () const
 
Real dMinus () const
 
Real dPlusTau12 (Real S) const
 
Real dMinusTau12 () const
 
Real strikeDaughter () const
 
Real strikeMother () const
 
Real spot () const
 
Real volatilityDaughter () const
 
Real volatilityMother () const
 
Real riskFreeRateDaughter () const
 
Real dividendRateDaughter () const
 
Real stdDeviationDaughter () const
 
Real stdDeviationMother () const
 
Real typeDaughter () const
 
Real typeMother () const
 
Real transformX (Real X) const
 
Real e (Real X) const
 
DiscountFactor riskFreeDiscountDaughter () const
 
DiscountFactor riskFreeDiscountMother () const
 
DiscountFactor riskFreeDiscountMotherDaughter () const
 
DiscountFactor dividendDiscountDaughter () const
 
DiscountFactor dividendDiscountMother () const
 
DiscountFactor dividendDiscountMotherDaughter () const
 
ext::shared_ptr< PlainVanillaPayoffpayoffMother () const
 
ext::shared_ptr< PlainVanillaPayoffpayoffDaughter () const
 

Private Attributes

CumulativeNormalDistribution N_
 
NormalDistribution n_
 
ext::shared_ptr< GeneralizedBlackScholesProcessprocess_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Attributes inherited from GenericEngine< CompoundOption::arguments, CompoundOption::results >
CompoundOption::arguments arguments_
 
CompoundOption::results results_
 

Detailed Description

Pricing engine for compound options using analytical formulae.

The formulas are taken from "Foreign Exchange Risk", Uwe Wystup, Risk 2002, where closed form Greeks are available. (not available in Haug 2007). Value: Page 84, Greeks: Pages 94-95.

Tests:
the correctness of the returned value is tested by reproducing results available in literature.

Definition at line 42 of file analyticcompoundoptionengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticCompoundOptionEngine()

AnalyticCompoundOptionEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process)
explicit

Definition at line 56 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 62 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:

◆ residualTimeMother()

Time residualTimeMother ( ) const
private

Definition at line 171 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ residualTimeDaughter()

Time residualTimeDaughter ( ) const
private

Definition at line 167 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ residualTimeMotherDaughter()

Time residualTimeMotherDaughter ( ) const
private

Definition at line 175 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maturityMother()

Date maturityMother ( ) const
private

Definition at line 163 of file analyticcompoundoptionengine.cpp.

+ Here is the caller graph for this function:

◆ maturityDaughter()

Date maturityDaughter ( ) const
private

Definition at line 159 of file analyticcompoundoptionengine.cpp.

+ Here is the caller graph for this function:

◆ dPlus()

Real dPlus ( ) const
private

Definition at line 249 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dMinus()

Real dMinus ( ) const
private

Definition at line 255 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dPlusTau12()

Real dPlusTau12 ( Real  S) const
private

Definition at line 259 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dMinusTau12()

Real dMinusTau12 ( ) const
private

◆ strikeDaughter()

Real strikeDaughter ( ) const
private

Definition at line 221 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strikeMother()

Real strikeMother ( ) const
private

Definition at line 217 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spot()

Real spot ( ) const
private

Definition at line 265 of file analyticcompoundoptionengine.cpp.

+ Here is the caller graph for this function:

◆ volatilityDaughter()

Real volatilityDaughter ( ) const
private

Definition at line 180 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ volatilityMother()

Real volatilityMother ( ) const
private

Definition at line 186 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ riskFreeRateDaughter()

Real riskFreeRateDaughter ( ) const
private

Definition at line 269 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dividendRateDaughter()

Real dividendRateDaughter ( ) const
private

Definition at line 275 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stdDeviationDaughter()

Real stdDeviationDaughter ( ) const
private

Definition at line 191 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stdDeviationMother()

Real stdDeviationMother ( ) const
private

Definition at line 195 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typeDaughter()

Real typeDaughter ( ) const
private

Definition at line 150 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typeMother()

Real typeMother ( ) const
private

Definition at line 155 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transformX()

Real transformX ( Real  X) const
private

Definition at line 281 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ e()

Real e ( Real  X) const
private

Definition at line 291 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ riskFreeDiscountDaughter()

DiscountFactor riskFreeDiscountDaughter ( ) const
private

Definition at line 225 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ riskFreeDiscountMother()

DiscountFactor riskFreeDiscountMother ( ) const
private

Definition at line 229 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ riskFreeDiscountMotherDaughter()

DiscountFactor riskFreeDiscountMotherDaughter ( ) const
private

Definition at line 233 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dividendDiscountDaughter()

DiscountFactor dividendDiscountDaughter ( ) const
private

Definition at line 237 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dividendDiscountMother()

DiscountFactor dividendDiscountMother ( ) const
private

Definition at line 241 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dividendDiscountMotherDaughter()

DiscountFactor dividendDiscountMotherDaughter ( ) const
private

Definition at line 245 of file analyticcompoundoptionengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ payoffMother()

ext::shared_ptr< PlainVanillaPayoff > payoffMother ( ) const
private

Definition at line 210 of file analyticcompoundoptionengine.cpp.

+ Here is the caller graph for this function:

◆ payoffDaughter()

ext::shared_ptr< PlainVanillaPayoff > payoffDaughter ( ) const
private

Definition at line 201 of file analyticcompoundoptionengine.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ N_

Definition at line 49 of file analyticcompoundoptionengine.hpp.

◆ n_

NormalDistribution n_
private

Definition at line 50 of file analyticcompoundoptionengine.hpp.

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 51 of file analyticcompoundoptionengine.hpp.