QuantLib: AnalyticEuropeanEngine Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Member Functions | List of all members
AnalyticEuropeanEngine Class Reference
Pricing engines » Vanilla option engines

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

`#include <ql/pricingengines/vanilla/analyticeuropeanengine.hpp>`

Inherits engine.

## Public Member Functions
| AnalyticEuropeanEngine (const boost::shared_ptr< GeneralizedBlackScholesProcess > &)
| AnalyticEuropeanEngine (const boost::shared_ptr< GeneralizedBlackScholesProcess > &process, const Handle< YieldTermStructure > &discountCurve)
void | calculate () const

## 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.

Examples:
  EquityOption.cpp, and Replication.cpp.

## Constructor & Destructor Documentation

## ◆ AnalyticEuropeanEngine() [1/2]

AnalyticEuropeanEngine | ( | const boost::shared_ptr< GeneralizedBlackScholesProcess > & |  | ) |

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

## ◆ AnalyticEuropeanEngine() [2/2]

AnalyticEuropeanEngine | ( | const boost::shared_ptr< GeneralizedBlackScholesProcess > & | process,
|  | const 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.