Logo
Reference manual - version qle_version
Public Types | Public Member Functions | List of all members
DiscountingCurrencySwapEngineDeltaGamma Class Reference

Discounting currency swap engine providing analytical deltas and gammas. More...

#include <qle/pricingengines/discountingcurrencyswapenginedeltagamma.hpp>

+ Inheritance diagram for DiscountingCurrencySwapEngineDeltaGamma:

Public Types

typedef std::map< Currency, Matrix, CurrencyComparatorresult_type_matrix
 
typedef std::map< Currency, std::vector< Real >, CurrencyComparatorresult_type_vector
 
typedef std::map< Currency, Real, CurrencyComparatorresult_type_scalar
 

Public Member Functions

 DiscountingCurrencySwapEngineDeltaGamma (const std::vector< Handle< YieldTermStructure >> &discountCurves, const std::vector< Handle< Quote >> &fxQuotes, const std::vector< Currency > &currencies, const Currency &npvCurrency, const std::vector< Time > &bucketTimes=std::vector< Time >(), const bool computeDelta=false, const bool computeGamma=false, const bool linearInZero=true, const bool applySimmExemptions=false)
 
void calculate () const override
 
std::vector< Handle< YieldTermStructure > > discountCurves ()
 
std::vector< Currency > currencies ()
 
Currency npvCurrency ()
 

Detailed Description

Discounting currency swap engine providing analytical deltas and gammas.

This class generalizes QuantLib's DiscountingSwapEngine. It takes leg currencies into account and converts into the provided "npv currency", which must be one of the leg currencies. The evaluation date is the reference date of either of the discounting curves (which must be equal).

The same comments as in discountingswapenginedeltagamma.hpp apply here, so read them first.

The engine processes FX linked flows from xccy resetting swaps, but only captures the additional FX Spot Delta risk coming from the reset feature. Interest Deltas and Gammas coming from the FX forwarding factor P_for / P_dom are neglected, this factor is treated as a constant for the purpose of sensitivity calculation.

Here, the additional results are:

deltaDiscount (map<Currency, vector<Real>> ): Delta on discount curve, rebucketed, values are in currency deltaForward (map<Currency, vector<Real>> ): Delta on forward curve, rebucketed, value are in currency deltaFxSpot (map<Currency, Real> ): Delta on FX Spot (for all leg currencies, even if = npv ccy)

gamma (map<Currency, Matrix> ): Gamma matrix per currency with blocks | dsc-dsc dsc-fwd | | dsc-fwd fwd-fwd | (note that the second derivatives including the FX Spot are zero for the pure second derivative w.r.t. the FX Spot or given by the in currency delta values provided as the additional result deltaDiscount, deltaForward, to be reinterpreted as values in domestic currency)

fxSpot (map<Currency, Real> ): FX Spot used for conversion to npvCurrency (for all leg ccys) bucketTimes (vector<Real> ): Bucketing grid for deltas and gammas

Warning:
: The assumption is that per currency we only have one discount and one forward curve. It is possible to have several, but then the computed deltas will be aggregated over all those curves.

Constructor & Destructor Documentation

◆ DiscountingCurrencySwapEngineDeltaGamma()

DiscountingCurrencySwapEngineDeltaGamma ( const std::vector< Handle< YieldTermStructure >> &  discountCurves,
const std::vector< Handle< Quote >> &  fxQuotes,
const std::vector< Currency > &  currencies,
const Currency &  npvCurrency,
const std::vector< Time > &  bucketTimes = std::vector< Time >(),
const bool  computeDelta = false,
const bool  computeGamma = false,
const bool  linearInZero = true,
const bool  applySimmExemptions = false 
)

The FX spots must be given as units of npvCurrency per respective currency. The spots must be given w.r.t. a settlement date equal to the npv date (which is the reference date of the term structures).

If applySimmExemptions = true, simple cashflows will be excluded from the additional results listed above (but not from the npv / leg npv results) if

  • the underlying instrument is physically settled and
  • the underlying instrument is not a resettable swap Notice that the SIMM adjustments for resettable swaps are not applied though!