Logo
Reference manual - version qle_version
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CommodityAveragePriceOptionBaseEngine Class Reference

#include <qle/pricingengines/commodityapoengine.hpp>

+ Inheritance diagram for CommodityAveragePriceOptionBaseEngine:

Public Member Functions

 CommodityAveragePriceOptionBaseEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantExt::BlackScholesModelWrapper > &model, QuantLib::Real beta=0.0)
 
 CommodityAveragePriceOptionBaseEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantLib::BlackVolTermStructure > &vol, QuantLib::Real beta=0.0)
 

Protected Member Functions

QuantLib::Real rho (const QuantLib::Date &ed_1, const QuantLib::Date &ed_2) const
 Return the correlation between two future expiry dates ed_1 and ed_2.
 
bool isModelDependent () const
 
bool barrierTriggered (const Real price, const bool logPrice) const
 
bool alive (const bool barrierTriggered) const
 

Protected Attributes

QuantLib::Handle< QuantLib::YieldTermStructure > discountCurve_
 
QuantLib::Handle< QuantLib::BlackVolTermStructure > volStructure_
 
QuantLib::Real beta_
 
QuantLib::Real logBarrier_
 

Detailed Description

Commodity APO Engine base class Correlation is parametrized as \(\rho(s, t) = \exp(-\beta * \abs(s - t))\) where \(s\) and \(t\) are times to futures expiry.

Member Function Documentation

◆ isModelDependent()

bool isModelDependent ( ) const
protected

In certain cases, the APO value is not model dependent. This method returns true if the APO value is model dependent. If the APO value is not model dependent, this method returns false and populates the results with the model independent value.

◆ barrierTriggered()

bool barrierTriggered ( const Real  price,
const bool  logPrice 
) const
protected

Check barriers on given (log-)price

◆ alive()

bool alive ( const bool  barrierTriggered) const
protected

Check whether option is alive depending on whether barrier was triggered