QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AnalyticTwoAssetBarrierEngine Class Reference

Analytic engine for barrier option on two assets. More...

#include <ql/experimental/exoticoptions/analytictwoassetbarrierengine.hpp>

+ Inheritance diagram for AnalyticTwoAssetBarrierEngine:
+ Collaboration diagram for AnalyticTwoAssetBarrierEngine:

Public Member Functions

 AnalyticTwoAssetBarrierEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process1, ext::shared_ptr< GeneralizedBlackScholesProcess > process2, Handle< Quote > rho)
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< TwoAssetBarrierOption::arguments, TwoAssetBarrierOption::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

Real underlying1 () const
 
Real underlying2 () const
 
Real strike () const
 
Time residualTime () const
 
Volatility volatility1 () const
 
Volatility volatility2 () const
 
Real barrier () const
 
Real rho () const
 
Rate riskFreeRate () const
 
Rate dividendYield1 () const
 
Rate dividendYield2 () const
 
Rate costOfCarry1 () const
 
Rate costOfCarry2 () const
 
Real mu (Real b, Real vol) const
 
Real d1 () const
 
Real d2 () const
 
Real d3 () const
 
Real d4 () const
 
Real e1 () const
 
Real e2 () const
 
Real e3 () const
 
Real e4 () const
 
Real call () const
 
Real put () const
 
Real A (Real eta, Real phi) const
 
Real B (Real eta, Real phi) const
 
Real M (Real m_a, Real m_b, Real rho) const
 

Private Attributes

ext::shared_ptr< GeneralizedBlackScholesProcessprocess1_
 
ext::shared_ptr< GeneralizedBlackScholesProcessprocess2_
 
Handle< Quoterho_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from TwoAssetBarrierOption::engine
bool triggered (Real underlying) const
 
- Protected Attributes inherited from GenericEngine< TwoAssetBarrierOption::arguments, TwoAssetBarrierOption::results >
TwoAssetBarrierOption::arguments arguments_
 
TwoAssetBarrierOption::results results_
 

Detailed Description

Analytic engine for barrier option on two assets.

The formulas are taken from "Option pricing formulas", E.G. Haug, McGraw-Hill,

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

Definition at line 41 of file analytictwoassetbarrierengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticTwoAssetBarrierEngine()

AnalyticTwoAssetBarrierEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process1,
ext::shared_ptr< GeneralizedBlackScholesProcess process2,
Handle< Quote rho 
)

Definition at line 28 of file analytictwoassetbarrierengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 38 of file analytictwoassetbarrierengine.cpp.

+ Here is the call graph for this function:

◆ underlying1()

Real underlying1 ( ) const
private

Definition at line 89 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ underlying2()

Real underlying2 ( ) const
private

Definition at line 93 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ strike()

Real strike ( ) const
private

Definition at line 97 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ residualTime()

Time residualTime ( ) const
private

Definition at line 104 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ volatility1()

Volatility volatility1 ( ) const
private

Definition at line 108 of file analytictwoassetbarrierengine.cpp.

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

◆ volatility2()

Volatility volatility2 ( ) const
private

Definition at line 112 of file analytictwoassetbarrierengine.cpp.

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

◆ barrier()

Real barrier ( ) const
private

Definition at line 116 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ rho()

Real rho ( ) const
private

Definition at line 120 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ riskFreeRate()

Rate riskFreeRate ( ) const
private

Definition at line 124 of file analytictwoassetbarrierengine.cpp.

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

◆ dividendYield1()

Rate dividendYield1 ( ) const
private

Definition at line 130 of file analytictwoassetbarrierengine.cpp.

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

◆ dividendYield2()

Rate dividendYield2 ( ) const
private

Definition at line 135 of file analytictwoassetbarrierengine.cpp.

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

◆ costOfCarry1()

Rate costOfCarry1 ( ) const
private

Definition at line 140 of file analytictwoassetbarrierengine.cpp.

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

◆ costOfCarry2()

Rate costOfCarry2 ( ) const
private

Definition at line 144 of file analytictwoassetbarrierengine.cpp.

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

◆ mu()

Real mu ( Real  b,
Real  vol 
) const
private

Definition at line 182 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ d1()

Real d1 ( ) const
private

Definition at line 148 of file analytictwoassetbarrierengine.cpp.

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

◆ d2()

Real d2 ( ) const
private

Definition at line 153 of file analytictwoassetbarrierengine.cpp.

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

◆ d3()

Real d3 ( ) const
private

Definition at line 157 of file analytictwoassetbarrierengine.cpp.

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

◆ d4()

Real d4 ( ) const
private

Definition at line 161 of file analytictwoassetbarrierengine.cpp.

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

◆ e1()

Real e1 ( ) const
private

Definition at line 165 of file analytictwoassetbarrierengine.cpp.

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

◆ e2()

Real e2 ( ) const
private

Definition at line 170 of file analytictwoassetbarrierengine.cpp.

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

◆ e3()

Real e3 ( ) const
private

Definition at line 174 of file analytictwoassetbarrierengine.cpp.

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

◆ e4()

Real e4 ( ) const
private

Definition at line 178 of file analytictwoassetbarrierengine.cpp.

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

◆ call()

Real call ( ) const
private

Definition at line 186 of file analytictwoassetbarrierengine.cpp.

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

◆ put()

Real put ( ) const
private

Definition at line 191 of file analytictwoassetbarrierengine.cpp.

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

◆ A()

Real A ( Real  eta,
Real  phi 
) const
private

Definition at line 196 of file analytictwoassetbarrierengine.cpp.

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

◆ B()

Real B ( Real  eta,
Real  phi 
) const
private

Definition at line 234 of file analytictwoassetbarrierengine.cpp.

+ Here is the caller graph for this function:

◆ M()

Real M ( Real  m_a,
Real  m_b,
Real  rho 
) const
private

Definition at line 238 of file analytictwoassetbarrierengine.cpp.

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

Member Data Documentation

◆ process1_

ext::shared_ptr<GeneralizedBlackScholesProcess> process1_
private

Definition at line 50 of file analytictwoassetbarrierengine.hpp.

◆ process2_

ext::shared_ptr<GeneralizedBlackScholesProcess> process2_
private

Definition at line 51 of file analytictwoassetbarrierengine.hpp.

◆ rho_

Handle<Quote> rho_
private

Definition at line 52 of file analytictwoassetbarrierengine.hpp.