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

Pricing engine for barrier options using binomial trees. More...

#include <binomialbarrierengine.hpp>

+ Inheritance diagram for BinomialBarrierEngine< T, D >:
+ Collaboration diagram for BinomialBarrierEngine< T, D >:

Public Member Functions

 BinomialBarrierEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process, Size timeSteps, Size maxTimeSteps=0)
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< BarrierOption::arguments, BarrierOption::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 Attributes

ext::shared_ptr< GeneralizedBlackScholesProcessprocess_
 
Size timeSteps_
 
Size maxTimeSteps_
 

Additional Inherited Members

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

Detailed Description

template<class T, class D>
class QuantLib::BinomialBarrierEngine< T, D >

Pricing engine for barrier options using binomial trees.

Note
Timesteps for Cox-Ross-Rubinstein trees are adjusted using Boyle and Lau algorithm. See Journal of Derivatives, 1/1994, "Bumping up against the barrier with the binomial method"
Tests:
the correctness of the returned values is tested by checking it against analytic european results.

Definition at line 50 of file binomialbarrierengine.hpp.

Constructor & Destructor Documentation

◆ BinomialBarrierEngine()

BinomialBarrierEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
Size  timeSteps,
Size  maxTimeSteps = 0 
)

The maxTimeSteps parameter is used to limit timeSteps when using Boyle-Lau optimization. If zero (the default) the maximum number of steps is calculated by an heuristic: anything when < 1000, otherwise no more than 5*timeSteps. If maxTimeSteps is equal to timeSteps, Boyle-Lau is disabled. Likewise if the lattice is not CoxRossRubinstein Boyle-Lau is disabled and maxTimeSteps ignored.

Definition at line 61 of file binomialbarrierengine.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculate()

void calculate
overridevirtual

Implements PricingEngine.

Definition at line 88 of file binomialbarrierengine.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 79 of file binomialbarrierengine.hpp.

◆ timeSteps_

Size timeSteps_
private

Definition at line 80 of file binomialbarrierengine.hpp.

◆ maxTimeSteps_

Size maxTimeSteps_
private

Definition at line 81 of file binomialbarrierengine.hpp.