20#include <ql/event.hpp>
21#include <ql/math/comparison.hpp>
26 Real notional1, Real notional2, Real basketNotional, Real cap, Real floor,
27 Real payoffLimit,
int accrualLag, Schedule valuationSchedule,
28 Schedule laggedValuationSchedule, Date settlementDate)
29 : position_(position), strike1_(strike1), strike2_(strike2), basketStrike_(basketStrike), notional1_(notional1),
30 notional2_(notional2), basketNotional_(basketNotional), cap_(cap), floor_(floor), payoffLimit_(payoffLimit),
31 accrualLag_(accrualLag), valuationSchedule_(valuationSchedule), laggedValuationSchedule_(laggedValuationSchedule),
32 settlementDate_(settlementDate) {}
36 QL_REQUIRE(
variance1_ != Null<Real>(),
"result not available");
42 QL_REQUIRE(
variance2_ != Null<Real>(),
"result not available");
54 QL_REQUIRE(
arguments !=
nullptr,
"wrong argument type");
73 Instrument::fetchResults(r);
81 QL_REQUIRE(
strike1 != Null<Real>(),
"no strike given for first underlying");
82 QL_REQUIRE(
strike1 > 0.0,
"negative or null strike given for first underlying");
83 QL_REQUIRE(
strike2 != Null<Real>(),
"no strike given for second underlying");
84 QL_REQUIRE(
strike2 > 0.0,
"negative or null strike given for second underlying");
85 QL_REQUIRE(
basketStrike != Null<Real>(),
"no strike given for basket");
86 QL_REQUIRE(
basketStrike > 0.0,
"negative or null strike given for basket");
88 QL_REQUIRE(
notional1 != Null<Real>(),
"no notional given for first underlying");
89 QL_REQUIRE(
notional1 > 0.0,
"negative or null notional given for first underlying");
90 QL_REQUIRE(
notional2 != Null<Real>(),
"no notional given for second underlying");
91 QL_REQUIRE(
notional2 > 0.0,
"negative or null notional given for second underlying");
92 QL_REQUIRE(
basketNotional != Null<Real>(),
"no notional given for basket");
93 QL_REQUIRE(
basketNotional > 0.0,
"negative or null notional given for basket");
95 QL_REQUIRE(
cap != Null<Real>(),
"no cap given");
96 QL_REQUIRE(
cap >= 0.0,
"cap must be non-negative");
97 QL_REQUIRE(
floor != Null<Real>(),
"no floor given");
98 QL_REQUIRE(
floor >= 0.0,
"floor must be non-negative");
99 QL_REQUIRE(
payoffLimit != Null<Real>(),
"no payoff limit given");
100 QL_REQUIRE(
payoffLimit > 0.0,
"payoff limit must be non-negative");
101 QL_REQUIRE(
accrualLag != Null<int>(),
"no accrual lag given");
106 "valuation schedule and lagged valuation schedule must have the same size");
107 QL_REQUIRE(
settlementDate != Date(),
"null settlement date given");
113 Instrument::setupExpired();
Schedule valuationSchedule
Schedule laggedValuationSchedule
void validate() const override
Results from pairwise variance-swap calculation
bool isExpired() const override
Schedule valuationSchedule_
Real basketVariance() const
void setupArguments(PricingEngine::arguments *args) const override
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
PairwiseVarianceSwap(const Position::Type position, const Real strike1, const Real strike2, const Real basketStrike, const Real notional1, const Real notional2, const Real basketNotional, const Real cap, const Real floor, const Real payoffLimit, const int accrualLag, const Schedule valuationSchedule, const Schedule laggedValuationSchedule, const Date settlementDate)
Schedule laggedValuationSchedule_