21#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
22#include <ql/termstructures/yieldtermstructure.hpp>
23#include <ql/math/comparison.hpp>
28 const ext::shared_ptr<YieldTermStructure>& fTS,
29 const ext::shared_ptr<BlackVolTermStructure>& fxVolTS,
const Real equityFxCorrelation,
30 const Real fxStrike,
const Real initialFxSpot,
const bool discounting,
31 const bool ensureNonNegativeForwardVariance)
32 : rTS_(rTS), fTS_(fTS), fxVolTS_(fxVolTS), equityFxCorrelation_(equityFxCorrelation), fxStrike_(fxStrike),
33 initialFxSpot_(initialFxSpot), discounting_(discounting),
34 ensureNonNegativeForwardVariance_(ensureNonNegativeForwardVariance) {
35 QL_REQUIRE(
fxStrike_ != Null<Real>() || initialFxSpot != Null<Real>(),
36 "initialFxSpot must be given, if fxStrike is null (=atmf)");
40 Rate rDomestic = 0.0, rForeign = 0.0;
42 rDomestic =
rTS_->forwardRate(t1, t2, Continuous).rate();
43 rForeign =
fTS_->forwardRate(t1, t2, Continuous).rate();
57 const Volatility fxVol = std::sqrt(v);
62 Rate rDomestic = 0.0, rForeign = 0.0;
64 rDomestic =
rTS_->forwardRate(t1, t2, Continuous).rate();
65 rForeign =
fTS_->forwardRate(t1, t2, Continuous).rate();
79 const Volatility fxVol = std::sqrt(v);
80 Array retVal(equityVol.size());
81 for (Size i = 0; i < retVal.size(); ++i) {
const bool ensureNonNegativeForwardVariance_
const ext::shared_ptr< YieldTermStructure > fTS_
const ext::shared_ptr< BlackVolTermStructure > fxVolTS_
FdmQuantoHelper(const ext::shared_ptr< YieldTermStructure > &rTS, const ext::shared_ptr< YieldTermStructure > &fTS, const ext::shared_ptr< BlackVolTermStructure > &fxVolTS, const Real equityFxCorrelation, const Real fxStrike, Real initialFxSpot=Null< Real >(), const bool discounting=true, const bool ensureNonNegativeForwardVariance=false)
const Real equityFxCorrelation_
const ext::shared_ptr< YieldTermStructure > rTS_
const Real initialFxSpot_
Rate quantoAdjustment(Volatility equityVol, Time t1, Time t2) const
extended version of the QuantLib class, see the documentation for details
Filter close_enough(const RandomVariable &x, const RandomVariable &y)