Skip to content

Commit

Permalink
Change payment lag from Naturals to Ints (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Nov 9, 2023
2 parents 0dba37c + 403e8bd commit 5babd27
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions SWIG/bonds.i
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class AmortizingFixedRateBond : public Bond {
const BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const std::vector<Real>& redemptions = { 100.0 },
Natural paymentLag = 0);
Integer paymentLag = 0);
Frequency frequency() const;
DayCounter dayCounter() const;
};
Expand Down Expand Up @@ -241,7 +241,7 @@ class AmortizingFloatingRateBond : public Bond {
const BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const std::vector<Real>& redemptions = { 100.0 },
Natural paymentLag = 0);;
Integer paymentLag = 0);
};


Expand Down
16 changes: 8 additions & 8 deletions SWIG/cashflows.i
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ Leg _FixedRateLeg(const Schedule& schedule,
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const Calendar& paymentCalendar = Calendar(),
const Natural paymentLag = 0,
const Integer paymentLag = 0,
Compounding comp = Simple,
Frequency freq = Annual) {
return QuantLib::FixedRateLeg(schedule)
Expand Down Expand Up @@ -708,7 +708,7 @@ Leg _FixedRateLeg(const Schedule& schedule,
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const Calendar& paymentCalendar = Calendar(),
Natural paymentLag = 0,
Integer paymentLag = 0,
Compounding compounding = Simple,
Frequency compoundingFrequency = Annual);

Expand All @@ -729,7 +729,7 @@ Leg _IborLeg(const std::vector<Real>& nominals,
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const Calendar& paymentCalendar = Calendar(),
const Natural paymentLag = 0,
const Integer paymentLag = 0,
ext::optional<bool> withIndexedCoupons = ext::nullopt) {
return QuantLib::IborLeg(schedule, index)
.withNotionals(nominals)
Expand Down Expand Up @@ -770,7 +770,7 @@ Leg _IborLeg(const std::vector<Real>& nominals,
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const Calendar& paymentCalendar = Calendar(),
Natural paymentLag = 0,
Integer paymentLag = 0,
ext::optional<bool> withIndexedCoupons = ext::nullopt);

%{
Expand All @@ -784,7 +784,7 @@ Leg _OvernightLeg(const std::vector<Real>& nominals,
bool telescopicValueDates = false,
RateAveraging::Type averagingMethod = RateAveraging::Compound,
const Calendar& paymentCalendar = Calendar(),
const Natural paymentLag = 0) {
const Integer paymentLag = 0) {
return QuantLib::OvernightLeg(schedule, index)
.withNotionals(nominals)
.withPaymentDayCounter(paymentDayCounter)
Expand All @@ -811,7 +811,7 @@ Leg _OvernightLeg(const std::vector<Real>& nominals,
bool telescopicValueDates = false,
RateAveraging::Type averagingMethod = RateAveraging::Compound,
const Calendar& paymentCalendar = Calendar(),
Natural paymentLag = 0);
Integer paymentLag = 0);

%{
Leg _CmsLeg(const std::vector<Real>& nominals,
Expand Down Expand Up @@ -958,7 +958,7 @@ Leg _SubPeriodsLeg(const std::vector<Real>& nominals,
const DayCounter& paymentDayCounter = DayCounter(),
const BusinessDayConvention paymentConvention = Following,
const Calendar& paymentCalendar = Calendar(),
Natural paymentLag = 0,
Integer paymentLag = 0,
const std::vector<Natural>& fixingDays = std::vector<Natural>(),
const std::vector<Real>& gearings = std::vector<Real>(),
const std::vector<Spread>& couponSpreads = std::vector<Spread>(),
Expand Down Expand Up @@ -995,7 +995,7 @@ Leg _SubPeriodsLeg(const std::vector<Real>& nominals,
const DayCounter& paymentDayCounter = DayCounter(),
const BusinessDayConvention paymentConvention = Following,
const Calendar& paymentCalendar = Calendar(),
Natural paymentLag = 0,
Integer paymentLag = 0,
const std::vector<Natural>& fixingDays = std::vector<Natural>(),
const std::vector<Real>& gearings = std::vector<Real>(),
const std::vector<Spread>& couponSpreads = std::vector<Spread>(),
Expand Down
4 changes: 2 additions & 2 deletions SWIG/ratehelpers.i
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class OISRateHelper : public RateHelper {
const ext::shared_ptr<OvernightIndex>& index,
const Handle<YieldTermStructure>& discountingCurve = {},
bool telescopicValueDates = false,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentConvention = Following,
Frequency paymentFrequency = Annual,
const Calendar& paymentCalendar = Calendar(),
Expand All @@ -348,7 +348,7 @@ class DatedOISRateHelper : public RateHelper {
const Handle<YieldTermStructure>& discountingCurve = {},
bool telescopicValueDates = false,
RateAveraging::Type averagingMethod = RateAveraging::Compound,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentConvention = Following,
Frequency paymentFrequency = Annual,
const Calendar& paymentCalendar = Calendar(),
Expand Down
8 changes: 4 additions & 4 deletions SWIG/swap.i
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class OvernightIndexedSwap : public Swap {
const DayCounter& fixedDC,
const ext::shared_ptr<OvernightIndex>& index,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
Calendar paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand All @@ -375,7 +375,7 @@ class OvernightIndexedSwap : public Swap {
const DayCounter& fixedDC,
const ext::shared_ptr<OvernightIndex>& index,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
Calendar paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand All @@ -390,7 +390,7 @@ class OvernightIndexedSwap : public Swap {
const Schedule& overnightSchedule,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
const Calendar& paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand Down Expand Up @@ -441,7 +441,7 @@ class MakeOIS {
MakeOIS& withRule(DateGeneration::Rule r);
MakeOIS& withPaymentFrequency(Frequency f);
MakeOIS& withPaymentAdjustment(BusinessDayConvention convention);
MakeOIS& withPaymentLag(Natural lag);
MakeOIS& withPaymentLag(Integer lag);
MakeOIS& withPaymentCalendar(const Calendar& cal);
MakeOIS& withEndOfMonth(bool flag = true);
MakeOIS& withFixedLegDayCount(const DayCounter& dc);
Expand Down

0 comments on commit 5babd27

Please sign in to comment.