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

Finite-differences Black Scholes vanilla option engine. More...

#include <fdblackscholesvanillaengine.hpp>

+ Inheritance diagram for FdBlackScholesVanillaEngine:
+ Collaboration diagram for FdBlackScholesVanillaEngine:

Public Types

enum  CashDividendModel { Spot , Escrowed }
 

Public Member Functions

 FdBlackScholesVanillaEngine (ext::shared_ptr< GeneralizedBlackScholesProcess >, Size tGrid=100, Size xGrid=100, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Douglas(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >(), CashDividendModel cashDividendModel=Spot)
 
 FdBlackScholesVanillaEngine (ext::shared_ptr< GeneralizedBlackScholesProcess >, DividendSchedule dividends, Size tGrid=100, Size xGrid=100, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Douglas(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >(), CashDividendModel cashDividendModel=Spot)
 
 FdBlackScholesVanillaEngine (ext::shared_ptr< GeneralizedBlackScholesProcess >, ext::shared_ptr< FdmQuantoHelper > quantoHelper, Size tGrid=100, Size xGrid=100, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Douglas(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >(), CashDividendModel cashDividendModel=Spot)
 
 FdBlackScholesVanillaEngine (ext::shared_ptr< GeneralizedBlackScholesProcess >, DividendSchedule dividends, ext::shared_ptr< FdmQuantoHelper > quantoHelper, Size tGrid=100, Size xGrid=100, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Douglas(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >(), CashDividendModel cashDividendModel=Spot)
 
void calculate () const override
 

Private Attributes

ext::shared_ptr< GeneralizedBlackScholesProcessprocess_
 
DividendSchedule dividends_
 
Size tGrid_
 
Size xGrid_
 
Size dampingSteps_
 
FdmSchemeDesc schemeDesc_
 
bool localVol_
 
Real illegalLocalVolOverwrite_
 
ext::shared_ptr< FdmQuantoHelperquantoHelper_
 
CashDividendModel cashDividendModel_
 

Detailed Description

Finite-differences Black Scholes vanilla option engine.

Tests:
the correctness of the returned value is tested by reproducing results available in web/literature and comparison with Black pricing.

Definition at line 45 of file fdblackscholesvanillaengine.hpp.

Member Enumeration Documentation

◆ CashDividendModel

Enumerator
Spot 
Escrowed 

Definition at line 47 of file fdblackscholesvanillaengine.hpp.

Constructor & Destructor Documentation

◆ FdBlackScholesVanillaEngine() [1/4]

FdBlackScholesVanillaEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
Size  tGrid = 100,
Size  xGrid = 100,
Size  dampingSteps = 0,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Douglas(),
bool  localVol = false,
Real  illegalLocalVolOverwrite = -Null<Real>(),
CashDividendModel  cashDividendModel = Spot 
)
explicit

Definition at line 37 of file fdblackscholesvanillaengine.cpp.

◆ FdBlackScholesVanillaEngine() [2/4]

FdBlackScholesVanillaEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
DividendSchedule  dividends,
Size  tGrid = 100,
Size  xGrid = 100,
Size  dampingSteps = 0,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Douglas(),
bool  localVol = false,
Real  illegalLocalVolOverwrite = -Null<Real>(),
CashDividendModel  cashDividendModel = Spot 
)

Definition at line 52 of file fdblackscholesvanillaengine.cpp.

◆ FdBlackScholesVanillaEngine() [3/4]

FdBlackScholesVanillaEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
ext::shared_ptr< FdmQuantoHelper quantoHelper,
Size  tGrid = 100,
Size  xGrid = 100,
Size  dampingSteps = 0,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Douglas(),
bool  localVol = false,
Real  illegalLocalVolOverwrite = -Null<Real>(),
CashDividendModel  cashDividendModel = Spot 
)

Definition at line 69 of file fdblackscholesvanillaengine.cpp.

◆ FdBlackScholesVanillaEngine() [4/4]

FdBlackScholesVanillaEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
DividendSchedule  dividends,
ext::shared_ptr< FdmQuantoHelper quantoHelper,
Size  tGrid = 100,
Size  xGrid = 100,
Size  dampingSteps = 0,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Douglas(),
bool  localVol = false,
Real  illegalLocalVolOverwrite = -Null<Real>(),
CashDividendModel  cashDividendModel = Spot 
)

Definition at line 88 of file fdblackscholesvanillaengine.cpp.

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 109 of file fdblackscholesvanillaengine.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 96 of file fdblackscholesvanillaengine.hpp.

◆ dividends_

DividendSchedule dividends_
private

Definition at line 97 of file fdblackscholesvanillaengine.hpp.

◆ tGrid_

Size tGrid_
private

Definition at line 98 of file fdblackscholesvanillaengine.hpp.

◆ xGrid_

Size xGrid_
private

Definition at line 98 of file fdblackscholesvanillaengine.hpp.

◆ dampingSteps_

Size dampingSteps_
private

Definition at line 98 of file fdblackscholesvanillaengine.hpp.

◆ schemeDesc_

FdmSchemeDesc schemeDesc_
private

Definition at line 99 of file fdblackscholesvanillaengine.hpp.

◆ localVol_

bool localVol_
private

Definition at line 100 of file fdblackscholesvanillaengine.hpp.

◆ illegalLocalVolOverwrite_

Real illegalLocalVolOverwrite_
private

Definition at line 101 of file fdblackscholesvanillaengine.hpp.

◆ quantoHelper_

ext::shared_ptr<FdmQuantoHelper> quantoHelper_
private

Definition at line 102 of file fdblackscholesvanillaengine.hpp.

◆ cashDividendModel_

CashDividendModel cashDividendModel_
private

Definition at line 103 of file fdblackscholesvanillaengine.hpp.