32 Handle<YieldTermStructure>
33 configureDividendHandle(
const Handle<YieldTermStructure>& dividendHandle) {
34 if (dividendHandle.empty()) {
35 ext::shared_ptr<YieldTermStructure> flatTs(ext::make_shared<FlatForward>(
36 0, NullCalendar(), Handle<Quote>(ext::make_shared<SimpleQuote>(0.0)),
38 return Handle<YieldTermStructure>(flatTs);
40 return dividendHandle;
45 for (
const auto& i : leg) {
46 ext::shared_ptr<EquityCashFlow> c =
47 ext::dynamic_pointer_cast<EquityCashFlow>(i);
54 ext::shared_ptr<EquityIndex> index,
56 const Date& fixingDate,
57 const Date& paymentDate,
59 :
IndexedCashFlow(notional,
std::move(index), baseDate, fixingDate, paymentDate, growthOnly) {}
82 : quantoCurrencyTermStructure_(
std::move(quantoCurrencyTermStructure)),
83 equityVolatility_(
std::move(equityVolatility)), fxVolatility_(
std::move(fxVolatility)),
92 index_ = ext::dynamic_pointer_cast<EquityIndex>(cashFlow.
index());
94 QL_FAIL(
"Equity index required.");
102 "Quanto currency term structure handle cannot be empty.");
104 "Equity volatility term structure handle cannot be empty.");
106 "FX volatility term structure handle cannot be empty.");
112 "Quanto currency term structure, equity and FX volatility need to have the same "
119 configureDividendHandle(
index_->equityDividendCurve());
125 ext::shared_ptr<EquityIndex> quantoIndex =
132 return I1 / I0 - 1.0;
Actual/365 (Fixed) day counter.
ext::shared_ptr< EquityCashFlowPricer > pricer_
const ext::shared_ptr< EquityCashFlowPricer > & pricer() const
Real amount() const override
returns the amount of the cash flow
void setPricer(const ext::shared_ptr< EquityCashFlowPricer > &)
EquityCashFlow(Real notional, ext::shared_ptr< EquityIndex > index, const Date &baseDate, const Date &fixingDate, const Date &paymentDate, bool growthOnly=true)
ext::shared_ptr< EquityIndex > index_
Handle< Quote > correlation_
EquityQuantoCashFlowPricer(Handle< YieldTermStructure > quantoCurrencyTermStructure, Handle< BlackVolTermStructure > equityVolatility, Handle< BlackVolTermStructure > fxVolatility, Handle< Quote > correlation)
void initialize(const EquityCashFlow &) override
Real price() const override
Handle< YieldTermStructure > quantoTermStructure
Handle< BlackVolTermStructure > fxVolatility_
Handle< YieldTermStructure > quantoCurrencyTermStructure_
Handle< BlackVolTermStructure > equityVolatility_
Shared handle to an observable.
Cash flow dependent on an index ratio.
virtual Date fixingDate() const
virtual Real notional() const
Real amount() const override
returns the amount of the cash flow
virtual Date baseDate() const
virtual bool growthOnly() const
virtual ext::shared_ptr< Index > index() const
Size unregisterWith(const ext::shared_ptr< Observable > &)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
base class for equity indexes
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
flat forward rate term structure
Cash flow dependent on an index ratio (NOT a coupon, i.e. no accruals)
void setCouponPricer(const Leg &leg, const ext::shared_ptr< FloatingRateCouponPricer > &pricer)
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Calendar for reproducing theoretical calculations.