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

analytic engine for partial-time barrier options. More...

#include <analyticpartialtimebarrieroptionengine.hpp>

+ Inheritance diagram for AnalyticPartialTimeBarrierOptionEngine:
+ Collaboration diagram for AnalyticPartialTimeBarrierOptionEngine:

Public Member Functions

 AnalyticPartialTimeBarrierOptionEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process)
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< PartialTimeBarrierOption::arguments, PartialTimeBarrierOption::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 ()=default
 
 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 calculate (PartialTimeBarrierOption::arguments &arguments, const ext::shared_ptr< PlainVanillaPayoff > &payoff, const ext::shared_ptr< GeneralizedBlackScholesProcess > &process) const
 
Real underlying () const
 
Time residualTime () const
 
Time coverEventTime () const
 
Volatility volatility (Time t, Real strike) const
 
Real M (Real a, Real b, Real rho) const
 
Real d1 (Real strike, Rate b) const
 
Real d2 (Real strike, Rate b) const
 
Real e1 (Real barrier, Real strike, Rate b) const
 
Real e2 (Real barrier, Real strike, Rate b) const
 
Real e3 (Real barrier, Real strike, Rate b) const
 
Real e4 (Real barrier, Real strike, Rate b) const
 
Real f1 (Real barrier, Real strike, Rate b) const
 
Real f2 (Real barrier, Real strike, Rate b) const
 
Real rho () const
 
Rate mu (Real strike, Rate b) const
 
Real CoB2 (Barrier::Type barrierType, Real barrier, Real strike, Rate r, Rate q) const
 
Real CoB1 (Real barrier, Real strike, Rate r, Rate q) const
 
Real CA (Integer n, Real barrier, Real strike, Rate r, Rate q) const
 
Real CIA (Integer n, Real barrier, Real strike, Rate r, Rate q) const
 
Real g1 (Real barrier, Real strike, Rate b) const
 
Real g2 (Real barrier, Real strike, Rate b) const
 
Real g3 (Real barrier, Real strike, Rate b) const
 
Real g4 (Real barrier, Real strike, Rate b) const
 
Real HS (Real S, Real H, Real power) const
 

Private Attributes

ext::shared_ptr< GeneralizedBlackScholesProcessprocess_
 

Additional Inherited Members

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

Detailed Description

analytic engine for partial-time barrier options.

Formulas from Haug, Option Pricing Formulas.

It doesn't currently cover the case of knock-in partial-time end options.

Definition at line 38 of file analyticpartialtimebarrieroptionengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticPartialTimeBarrierOptionEngine()

Definition at line 28 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculate() [1/2]

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 101 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ calculate() [2/2]

Real calculate ( PartialTimeBarrierOption::arguments arguments,
const ext::shared_ptr< PlainVanillaPayoff > &  payoff,
const ext::shared_ptr< GeneralizedBlackScholesProcess > &  process 
) const
private

Definition at line 34 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the call graph for this function:

◆ underlying()

Real underlying ( ) const
private

Definition at line 266 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the caller graph for this function:

◆ residualTime()

Time residualTime ( ) const
private

Definition at line 270 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the caller graph for this function:

◆ coverEventTime()

Time coverEventTime ( ) const
private

Definition at line 274 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the caller graph for this function:

◆ volatility()

Volatility volatility ( Time  t,
Real  strike 
) const
private

Definition at line 278 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the caller graph for this function:

◆ M()

Real M ( Real  a,
Real  b,
Real  rho 
) const
private

Definition at line 295 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ d1()

Real d1 ( Real  strike,
Rate  b 
) const
private

Definition at line 309 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ d2()

Real d2 ( Real  strike,
Rate  b 
) const
private

Definition at line 315 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ e1()

Real e1 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 321 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ e2()

Real e2 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 327 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ e3()

Real e3 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 333 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ e4()

Real e4 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 339 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ f1()

Real f1 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 282 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ f2()

Real f2 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 290 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ rho()

Real rho ( ) const
private

Definition at line 300 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ mu()

Rate mu ( Real  strike,
Rate  b 
) const
private

Definition at line 304 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ CoB2()

Real CoB2 ( Barrier::Type  barrierType,
Real  barrier,
Real  strike,
Rate  r,
Rate  q 
) const
private

Definition at line 140 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ CoB1()

Real CoB1 ( Real  barrier,
Real  strike,
Rate  r,
Rate  q 
) const
private

Definition at line 188 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ CA()

Real CA ( Integer  n,
Real  barrier,
Real  strike,
Rate  r,
Rate  q 
) const
private

Definition at line 242 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ CIA()

Real CIA ( Integer  n,
Real  barrier,
Real  strike,
Rate  r,
Rate  q 
) const
private

Definition at line 227 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ g1()

Real g1 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 344 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ g2()

Real g2 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 350 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ g3()

Real g3 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 356 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ g4()

Real g4 ( Real  barrier,
Real  strike,
Rate  b 
) const
private

Definition at line 362 of file analyticpartialtimebarrieroptionengine.cpp.

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

◆ HS()

Real HS ( Real  S,
Real  H,
Real  power 
) const
private

Definition at line 368 of file analyticpartialtimebarrieroptionengine.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 46 of file analyticpartialtimebarrieroptionengine.hpp.