19#include <ql/cashflows/overnightindexedcoupon.hpp>
20#include <ql/cashflows/simplecashflow.hpp>
26 Real payNominal, Currency payCurrency,
const Schedule& paySchedule,
27 const QuantLib::ext::shared_ptr<OvernightIndex>& payIndex, Real paySpread, Real recNominal, Currency recCurrency,
28 const Schedule& recSchedule,
const QuantLib::ext::shared_ptr<OvernightIndex>& recIndex, Real recSpread)
29 : Swap(2), payNominal_(payNominal), recNominal_(recNominal), payCurrency_(payCurrency), recCurrency_(recCurrency),
30 paySchedule_(paySchedule), recSchedule_(recSchedule), payIndex_(payIndex), recIndex_(recIndex),
31 paySpread_(paySpread), recSpread_(recSpread), currency_(2) {
40 legs_[0].insert(legs_[0].begin(),
42 legs_[0].push_back(QuantLib::ext::shared_ptr<CashFlow>(
new SimpleCashFlow(
payNominal_,
paySchedule_.dates().back())));
45 legs_[1].insert(legs_[1].begin(),
47 legs_[1].push_back(QuantLib::ext::shared_ptr<CashFlow>(
new SimpleCashFlow(
recNominal_,
recSchedule_.dates().back())));
49 for (Size j = 0; j < 2; ++j) {
50 for (Leg::iterator i = legs_[j].begin(); i != legs_[j].end(); ++i)
75 QL_REQUIRE(legBPS_[0] != Null<Real>(),
"result not available");
81 QL_REQUIRE(legBPS_[1] != Null<Real>(),
"result not available");
87 QL_REQUIRE(legNPV_[0] != Null<Real>(),
"result not available");
93 QL_REQUIRE(legNPV_[1] != Null<Real>(),
"result not available");
98 Swap::setupArguments(args);
102 QL_REQUIRE(
arguments != 0,
"wrong argument type");
110 Swap::fetchResults(r);
114 QL_REQUIRE(
results != 0,
"wrong result type");
121 Swap::results::reset();
std::vector< Currency > currency
Real fairPayLegSpread() const
QuantLib::ext::shared_ptr< OvernightIndex > recIndex_
std::vector< Currency > currency_
OvernightIndexedCrossCcyBasisSwap(Real payNominal, Currency payCurrency, const Schedule &paySchedule, const QuantLib::ext::shared_ptr< OvernightIndex > &payIndex, Real paySpread, Real recNominal, Currency recCurrency, const Schedule &recSchedule, const QuantLib::ext::shared_ptr< OvernightIndex > &recIndex, Real recSpread)
Spread fairRecLegSpread() const
const QuantLib::ext::shared_ptr< OvernightIndex > & payIndex()
void setupArguments(PricingEngine::arguments *args) const override
QuantLib::ext::shared_ptr< OvernightIndex > payIndex_
void fetchResults(const PricingEngine::results *) const override
const QuantLib::ext::shared_ptr< OvernightIndex > & recIndex()
helper class building a sequence of overnight coupons
OvernightLeg & withNotionals(Real notional)
OvernightLeg & withSpreads(Spread spread)
Cross currency overnight index swap paying compounded overnight vs. float.