diff --git a/ql/instruments/bonds/amortizingcmsratebond.cpp b/ql/instruments/bonds/amortizingcmsratebond.cpp index cce3e5638f9..ae6945c9f2f 100644 --- a/ql/instruments/bonds/amortizingcmsratebond.cpp +++ b/ql/instruments/bonds/amortizingcmsratebond.cpp @@ -38,7 +38,8 @@ namespace QuantLib { const std::vector& caps, const std::vector& floors, bool inArrears, - const Date& issueDate) + const Date& issueDate, + const std::vector& redemptions) : Bond(settlementDays, schedule.calendar(), issueDate) { maturityDate_ = schedule.endDate(); @@ -54,7 +55,7 @@ namespace QuantLib { .withFloors(floors) .inArrears(inArrears); - addRedemptionsToCashflows(); + addRedemptionsToCashflows(redemptions); QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); diff --git a/ql/instruments/bonds/amortizingcmsratebond.hpp b/ql/instruments/bonds/amortizingcmsratebond.hpp index 0a045d4e9c5..2c9560e2427 100644 --- a/ql/instruments/bonds/amortizingcmsratebond.hpp +++ b/ql/instruments/bonds/amortizingcmsratebond.hpp @@ -47,7 +47,8 @@ namespace QuantLib { const std::vector& caps = {}, const std::vector& floors = {}, bool inArrears = false, - const Date& issueDate = Date()); + const Date& issueDate = Date(), + const std::vector& redemptions = { 100.0 }); }; } diff --git a/ql/instruments/bonds/amortizingfixedratebond.cpp b/ql/instruments/bonds/amortizingfixedratebond.cpp index 8d912dd3ae6..824f2ec2e40 100644 --- a/ql/instruments/bonds/amortizingfixedratebond.cpp +++ b/ql/instruments/bonds/amortizingfixedratebond.cpp @@ -35,7 +35,9 @@ namespace QuantLib { const Period& exCouponPeriod, const Calendar& exCouponCalendar, const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth) + bool exCouponEndOfMonth, + const std::vector& redemptions, + Natural paymentLag) : Bond(settlementDays, schedule.calendar(), issueDate), frequency_(schedule.tenor().frequency()), dayCounter_(accrualDayCounter) { @@ -49,9 +51,10 @@ namespace QuantLib { .withExCouponPeriod(exCouponPeriod, exCouponCalendar, exCouponConvention, - exCouponEndOfMonth); + exCouponEndOfMonth) + .withPaymentLag(paymentLag); - addRedemptionsToCashflows(); + addRedemptionsToCashflows(redemptions); QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); } @@ -89,6 +92,7 @@ namespace QuantLib { addRedemptionsToCashflows(); } + AmortizingFixedRateBond::AmortizingFixedRateBond( Natural settlementDays, const std::vector& notionals, diff --git a/ql/instruments/bonds/amortizingfixedratebond.hpp b/ql/instruments/bonds/amortizingfixedratebond.hpp index 56e52ec0070..b966947fb1c 100644 --- a/ql/instruments/bonds/amortizingfixedratebond.hpp +++ b/ql/instruments/bonds/amortizingfixedratebond.hpp @@ -44,7 +44,9 @@ namespace QuantLib { const Period& exCouponPeriod = Period(), const Calendar& exCouponCalendar = Calendar(), BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false); + bool exCouponEndOfMonth = false, + const std::vector& redemptions = { 100.0 }, + Natural paymentLag = 0); /*! \deprecated Use the other constructor after calling sinkingSchedule and sinkingNotionals to generate the required parameters. diff --git a/ql/instruments/bonds/amortizingfloatingratebond.cpp b/ql/instruments/bonds/amortizingfloatingratebond.cpp index be7366d3a05..be2b9078c10 100644 --- a/ql/instruments/bonds/amortizingfloatingratebond.cpp +++ b/ql/instruments/bonds/amortizingfloatingratebond.cpp @@ -42,7 +42,9 @@ namespace QuantLib { const Period& exCouponPeriod, const Calendar& exCouponCalendar, const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth) + bool exCouponEndOfMonth, + const std::vector& redemptions, + Natural paymentLag) : Bond(settlementDays, schedule.calendar(), issueDate) { maturityDate_ = schedule.endDate(); @@ -52,6 +54,7 @@ namespace QuantLib { .withPaymentDayCounter(paymentDayCounter) .withPaymentAdjustment(paymentConvention) .withFixingDays(fixingDays) + .withPaymentLag(paymentLag) .withGearings(gearings) .withSpreads(spreads) .withCaps(caps) @@ -62,7 +65,7 @@ namespace QuantLib { exCouponEndOfMonth) .inArrears(inArrears); - addRedemptionsToCashflows(); + addRedemptionsToCashflows(redemptions); QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); diff --git a/ql/instruments/bonds/amortizingfloatingratebond.hpp b/ql/instruments/bonds/amortizingfloatingratebond.hpp index 071cad71f47..3db44a14ee6 100644 --- a/ql/instruments/bonds/amortizingfloatingratebond.hpp +++ b/ql/instruments/bonds/amortizingfloatingratebond.hpp @@ -50,9 +50,11 @@ namespace QuantLib { const Period& exCouponPeriod = Period(), const Calendar& exCouponCalendar = Calendar(), BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false); + bool exCouponEndOfMonth = false, + const std::vector& redemptions = { 100.0 }, + Natural paymentLag = 0); }; - + } #endif