Logo
Reference manual - version qle_version
CommoditySwaptionBaseEngine Class Reference

Commodity Swaption Engine base class. More...

#include <qle/pricingengines/commodityswaptionengine.hpp>

Inheritance diagram for CommoditySwaptionBaseEngine:

Public Member Functions

 CommoditySwaptionBaseEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< QuantLib::BlackVolTermStructure > &vol, Real beta=0.0)

Protected Member Functions

QuantLib::Size fixedLegIndex () const
QuantLib::Real fixedLegValue (QuantLib::Size fixedLegIndex) const
 Give back the fixed leg price at the swaption expiry time.
QuantLib::Real strike (QuantLib::Size fixedLegIndex) const
QuantLib::Real rho (const QuantLib::Date &ed_1, const QuantLib::Date &ed_2) const
bool averaging (QuantLib::Size floatLegIndex) const

Protected Attributes

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

Detailed Description

Commodity Swaption Engine base class.

Correlation is parametrized as rho(s, t) = exp(-beta * abs(s - t)) where s and t are times to futures expiry. This is described in detail in the ORE+ Product Catalogue.

Member Function Documentation

◆ fixedLegIndex()

QuantLib::Size fixedLegIndex ( ) const
protected

Performs checks on the underlying swap to ensure that:

  • it has two legs with a commodity fixed leg against a commodity floating leg
  • every cashflow on the commodity floating leg is either averaging or non-averaging Returns the index of the commodity fixed leg. Based on the checks, the commodity floating leg is the other leg.

◆ strike()

QuantLib::Real strike ( QuantLib::Size fixedLegIndex) const
protected

Need a strike price when querying the volatility surface in certain calculations. We take this as the first fixed leg period amount divided by the first floating leg quantity.

◆ rho()

QuantLib::Real rho ( const QuantLib::Date & ed_1,
const QuantLib::Date & ed_2 ) const
protected

Return the correlation between two future expiry dates ed_1 and ed_2

◆ averaging()

bool averaging ( QuantLib::Size floatLegIndex) const
protected

Return true if floating leg is averaging, otherwise false.