Inconsistent business day convention for reference periods in OvernightLeg

Open Beginner friendly
#3,134 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
fintech-quant

Research direction

Start in overnightindexedcoupon.cpp, where refStart and refEnd are adjusted with paymentAdjustment_; compare those lines with the corresponding reference-period adjustment in FixedRateLeg and FloatingLeg. Change the reference-period adjustments to use schedule_.businessDayConvention() while leaving the payment date on paymentAdjustment_. Run the overnight indexed coupon/leg tests to confirm irregular periods and accrual fractions still behave as expected.

Written by the indexing model from the issue text.

Description

In overnightindexedcoupon.cpp, the reference period start and end dates for irregular coupon periods are determined as follows:

refStart = calendar.adjust(end - schedule_.tenor(), paymentAdjustment_);

and

refEnd = calendar.adjust(start + schedule_.tenor(), paymentAdjustment_);

Both use paymentAdjustment_, which is also the business day convention used to determine the payment date:

paymentDate = paymentCalendar_.advance(end, paymentLag_, Days, paymentAdjustment_);

However, in other leg implementations, such as FixedRateLeg and FloatingLeg, the reference period dates are adjusted using schedule_.businessDayConvention() instead.

The latter approach seems more appropriate, since the reference period should follow the conventions of the underlying accrual schedule rather than those of the payment dates. Otherwise, changing the payment convention alone may unintentionally affect the reference period and, potentially, the accrual fraction.

Dominant language
C++
Stars
7.7k
Forks
2.3k
Avg merge
4d 14h
Merged PRs (30d)
100

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lballabio/QuantLib

All issues in lballabio/QuantLib

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.