24 const Real notional,
const QuantLib::ext::shared_ptr<Index>& index,
25 const Real initialPrice,
const QuantLib::ext::shared_ptr<FxIndex>& fxIndex)
26 : paymentDate_(paymentDate), fixingStartDate_(fixingStartDate), fixingEndDate_(fixingEndDate),
27 notional_(notional), index_(index), initialPrice_(initialPrice), fxIndex_(fxIndex) {
37 Visitor<TRSCashFlow>* v1 =
dynamic_cast<Visitor<TRSCashFlow>*
>(&v);
59TRSLeg::TRSLeg(
const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
60 const Real notional,
const QuantLib::ext::shared_ptr<Index>& index,
61 const QuantLib::ext::shared_ptr<FxIndex>& fxIndex)
62 : valuationDates_(valuationDates), paymentDates_(paymentDates), notional_(notional), index_(index),
70TRSLeg::operator Leg()
const {
74 for (Size i = 0; i < valuationDates_.size() - 1; ++i) {
75 initialPrice = i == 0 ? initialPrice_ : Null<Real>();
76 leg.push_back(QuantLib::ext::make_shared<TRSCashFlow>(paymentDates_[i], valuationDates_[i], valuationDates_[i + 1],
77 notional_, index_, initialPrice, fxIndex_));
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
QuantLib::ext::shared_ptr< Index > index_
TRSCashFlow(const Date &paymentDate, const Date &fixingStartDate, const Date &fixingEndDate, const Real notional, const QuantLib::ext::shared_ptr< Index > &Index, const Real initialPrice=Null< Real >(), const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
Real amount() const override
virtual void accept(AcyclicVisitor &) override
Date date() const override
virtual const Real notional() const
helper class building a sequence of trs cashflows
TRSLeg & withInitialPrice(Real)
TRSLeg(const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const Real notional, const QuantLib::ext::shared_ptr< Index > &index, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
cashflow paying the total return of an asset