30 ext::shared_ptr<CashFlow>
31 compoundedSubPeriodicCoupon(
const Date& paymentDate,
32 const Date& startDate,
33 const Date& maturityDate,
35 const ext::shared_ptr<IborIndex>& index) {
36 auto floatCpn = ext::make_shared<SubPeriodsCoupon>(
37 paymentDate, nominal, startDate, maturityDate, index->fixingDays(), index);
39 ext::shared_ptr<FloatingRateCouponPricer>(
new CompoundingRatePricer));
46 const Date& startDate,
47 const Date& maturityDate,
48 ext::shared_ptr<IborIndex> iborIndex,
52 :
Swap(2), type_(type), baseNominal_(baseNominal), iborIndex_(
std::move(iborIndex)),
53 startDate_(startDate), maturityDate_(maturityDate) {
58 <<
") later than or equal to maturity date ("
65 for (Leg::const_iterator i =
legs_[1].begin(); i <
legs_[1].end(); ++i)
78 QL_FAIL(
"unknown zero coupon swap type");
84 const Date& startDate,
85 const Date& maturityDate,
87 ext::shared_ptr<IborIndex> iborIndex,
106 const Date& startDate,
107 const Date& maturityDate,
110 ext::shared_ptr<IborIndex> iborIndex,
118 std::move(iborIndex),
124 legs_[0].push_back(ext::shared_ptr<CashFlow>(
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Coupon paying a fixed interest rate
Concrete interest rate class.
static InterestRate impliedRate(Real compound, const DayCounter &resultDC, Compounding comp, Frequency freq, Time t)
implied interest rate for a given compound factor at a given time.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
DiscountFactor endDiscounts(Size j) const
const Leg & leg(Size j) const
Real legNPV(Size j) const
std::vector< Real > payer_
Zero-coupon interest rate swap.
Rate fairFixedRate(const DayCounter &dayCounter) const
ZeroCouponSwap(Type type, Real baseNominal, const Date &startDate, const Date &maturityDate, Real fixedPayment, ext::shared_ptr< IborIndex > iborIndex, const Calendar &paymentCalendar, BusinessDayConvention paymentConvention=Following, Natural paymentDelay=0)
const Leg & floatingLeg() const
just one cashflow in each leg
Date startDate() const override
Real fixedPayment() const
ext::shared_ptr< IborIndex > iborIndex_
const Leg & fixedLeg() const
just one cashflow in each leg
Date maturityDate() const override
Real floatingLegNPV() const
Real fairFixedPayment() const
#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)
Coupon paying a fixed annual rate.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
base class for Inter-Bank-Offered-Rate indexes
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Zero-coupon interest rate swap.