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
AnalyticEuropeanEngine Class Reference

Pricing engine for European vanilla options using analytical formulae. More...

#include <analyticeuropeanengine.hpp>

+ Inheritance diagram for AnalyticEuropeanEngine:
+ Collaboration diagram for AnalyticEuropeanEngine:

Public Member Functions

 AnalyticEuropeanEngine (ext::shared_ptr< GeneralizedBlackScholesProcess >)
 
 AnalyticEuropeanEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process, Handle< YieldTermStructure > discountCurve)
 
void calculate () const override
 

Private Attributes

ext::shared_ptr< GeneralizedBlackScholesProcessprocess_
 
Handle< YieldTermStructurediscountCurve_
 

Detailed Description

Pricing engine for European vanilla options using analytical formulae.

Tests:
  • the correctness of the returned value is tested by reproducing results available in literature.
  • the correctness of the returned greeks is tested by reproducing results available in literature.
  • the correctness of the returned greeks is tested by reproducing numerical derivatives.
  • the correctness of the returned implied volatility is tested by using it for reproducing the target value.
  • the implied-volatility calculation is tested by checking that it does not modify the option.
  • the correctness of the returned value in case of cash-or-nothing digital payoff is tested by reproducing results available in literature.
  • the correctness of the returned value in case of asset-or-nothing digital payoff is tested by reproducing results available in literature.
  • the correctness of the returned value in case of gap digital payoff is tested by reproducing results available in literature.
  • the correctness of the returned greeks in case of cash-or-nothing digital payoff is tested by reproducing numerical derivatives.

Definition at line 61 of file analyticeuropeanengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticEuropeanEngine() [1/2]

AnalyticEuropeanEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process)
explicit

This constructor triggers the usual calculation, in which the risk-free rate in the given process is used for both forecasting and discounting.

Definition at line 28 of file analyticeuropeanengine.cpp.

◆ AnalyticEuropeanEngine() [2/2]

AnalyticEuropeanEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess process,
Handle< YieldTermStructure discountCurve 
)

This constructor allows to use a different term structure for discounting the payoff. As usual, the risk-free rate from the given process is used for forecasting the forward price.

Definition at line 34 of file analyticeuropeanengine.cpp.

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 42 of file analyticeuropeanengine.cpp.

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

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 79 of file analyticeuropeanengine.hpp.

◆ discountCurve_

Handle<YieldTermStructure> discountCurve_
private

Definition at line 80 of file analyticeuropeanengine.hpp.