24#ifndef quantext_commodity_swaption_engine_hpp
25#define quantext_commodity_swaption_engine_hpp
27#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
28#include <ql/termstructures/yieldtermstructure.hpp>
42 const Handle<QuantLib::BlackVolTermStructure>& vol, Real beta = 0.0);
62 QuantLib::Real
rho(
const QuantLib::Date& ed_1,
const QuantLib::Date& ed_2)
const;
66 bool averaging(QuantLib::Size floatLegIndex)
const;
82 const Handle<QuantLib::BlackVolTermStructure>& vol, Real beta = 0.0)
91 QuantLib::Real
expA(QuantLib::Size floatLegIndex, QuantLib::Real normFactor)
const;
97 QuantLib::Real
expASquared(QuantLib::Size floatLegIndex, QuantLib::Real
strike, QuantLib::Real normFactor)
const;
102 QuantLib::Real
crossTerms(
const QuantLib::ext::shared_ptr<QuantLib::CashFlow>& cf_1,
103 const QuantLib::ext::shared_ptr<QuantLib::CashFlow>& cf_2,
bool isAveraging,
104 QuantLib::Real
strike, QuantLib::Real normFactor)
const;
109 QuantLib::Real
maxQuantity(QuantLib::Size floatLegIndex)
const;
119 const Handle<QuantLib::BlackVolTermStructure>& vol, Size samples, Real beta = 0.0,
120 const Size seed = 42)
126 void calculateSpot(QuantLib::Size idxFixed, QuantLib::Size idxFloat, QuantLib::Real
strike)
const;
134 QuantLib::Real
spotFloatLegFactor(QuantLib::Size idxFloat, QuantLib::Real discountExercise)
const;
140 const std::vector<QuantLib::Date>& expiries, QuantLib::Matrix& floatLegFactors,
141 QuantLib::Array& discounts, QuantLib::Array& amounts)
const;
150 std::map<QuantLib::Date, QuantLib::Real>
futureExpiries(QuantLib::Size idxFloat, QuantLib::Matrix& outSqrtCorr,
151 QuantLib::Real
strike)
const;
Commodity Swaption Engine base class.
Handle< QuantLib::BlackVolTermStructure > volStructure_
QuantLib::Real rho(const QuantLib::Date &ed_1, const QuantLib::Date &ed_2) const
Handle< YieldTermStructure > discountCurve_
QuantLib::Real fixedLegValue(QuantLib::Size fixedLegIndex) const
Give back the fixed leg price at the swaption expiry time.
bool averaging(QuantLib::Size floatLegIndex) const
QuantLib::Real strike(QuantLib::Size fixedLegIndex) const
QuantLib::Size fixedLegIndex() const
Commodity Swaption Analytical Engine.
CommoditySwaptionEngine(const Handle< YieldTermStructure > &discountCurve, const Handle< QuantLib::BlackVolTermStructure > &vol, Real beta=0.0)
QuantLib::Real expASquared(QuantLib::Size floatLegIndex, QuantLib::Real strike, QuantLib::Real normFactor) const
void calculate() const override
QuantLib::Real expA(QuantLib::Size floatLegIndex, QuantLib::Real normFactor) const
QuantLib::Real crossTerms(const QuantLib::ext::shared_ptr< QuantLib::CashFlow > &cf_1, const QuantLib::ext::shared_ptr< QuantLib::CashFlow > &cf_2, bool isAveraging, QuantLib::Real strike, QuantLib::Real normFactor) const
QuantLib::Real maxQuantity(QuantLib::Size floatLegIndex) const
Commodity Swaption Monte Carlo Engine.
void calculateSpot(QuantLib::Size idxFixed, QuantLib::Size idxFloat, QuantLib::Real strike) const
Calculations when underlying swap references a commodity spot price.
void calculate() const override
void futureFloatLegFactors(QuantLib::Size idxFloat, QuantLib::Real discountExercise, const std::vector< QuantLib::Date > &expiries, QuantLib::Matrix &floatLegFactors, QuantLib::Array &discounts, QuantLib::Array &amounts) const
void calculateFuture(QuantLib::Size idxFixed, QuantLib::Size idxFloat, QuantLib::Real strike) const
Calculations when underlying swap references a commodity spot price.
std::map< QuantLib::Date, QuantLib::Real > futureExpiries(QuantLib::Size idxFloat, QuantLib::Matrix &outSqrtCorr, QuantLib::Real strike) const
QuantLib::Real spotFloatLegFactor(QuantLib::Size idxFloat, QuantLib::Real discountExercise) const
CommoditySwaptionMonteCarloEngine(const Handle< YieldTermStructure > &discountCurve, const Handle< QuantLib::BlackVolTermStructure > &vol, Size samples, Real beta=0.0, const Size seed=42)
base class for swaption engines
base class for multi path generators