24 const Real bondNotional,
const QuantLib::ext::shared_ptr<BondIndex>& bondIndex,
25 const Real initialPrice,
const QuantLib::ext::shared_ptr<FxIndex>& fxIndex)
26 :
TRSCashFlow(paymentDate, fixingStartDate, fixingEndDate, bondNotional, bondIndex, initialPrice, fxIndex) {}
29 auto bondIndex = ext::dynamic_pointer_cast<BondIndex>(
index_);
30 QL_REQUIRE(bondIndex,
"BondTRSCashFlow::notional index must be a BondIndex");
35 QL_REQUIRE(fixingDate <
fixingEndDate_,
"BondTRSCashFlow fixingStartDate must be before fixingEndDate");
40 const Real bondNotional,
const QuantLib::ext::shared_ptr<BondIndex>& bondIndex,
41 const QuantLib::ext::shared_ptr<FxIndex>& fxIndex)
42 : valuationDates_(valuationDates), paymentDates_(paymentDates), bondNotional_(bondNotional), bondIndex_(bondIndex),
50BondTRSLeg::operator Leg()
const {
54 for (Size i = 0; i < valuationDates_.size() - 1; ++i) {
55 initialPrice = i == 0 ? initialPrice_ : Null<Real>();
56 leg.push_back(QuantLib::ext::make_shared<BondTRSCashFlow>(paymentDates_[i], valuationDates_[i], valuationDates_[i + 1],
57 bondNotional_, bondIndex_, initialPrice, fxIndex_));
cashflow paying the total return of a bond
BondTRSCashFlow(const Date &paymentDate, const Date &fixingStartDate, const Date &fixingEndDate, const Real bondNotional, const QuantLib::ext::shared_ptr< BondIndex > &bondIndex, const Real initialPrice=Null< Real >(), const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
void setFixingStartDate(QuantLib::Date fixingDate)
const Real notional() const override
helper class building a sequence of bond trs cashflows
BondTRSLeg & withInitialPrice(Real)
BondTRSLeg(const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const Real bondNotional, const QuantLib::ext::shared_ptr< BondIndex > &bondIndex, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
QuantLib::ext::shared_ptr< Index > index_