Bond irregular dates - #2694
Bond irregular dates#2694
Conversation
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.10.2 to 5.11.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](junit-team/junit-framework@r5.10.2...r5.11.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* overnight cap product * tests * javadoc * line * clean * white spaces * failing test for accrual
* PROD-42681: Adding Inauguration Day to MXMC * PROD-42681: Adding Inauguration Day to MXMC
* Overnight CapFloor CSV plugin * copyright * variable names --------- Co-authored-by: Alexis Skitini <skitini@users.noreply.github.com>
* overnight cap product * tests * javadoc * line * clean * white spaces * pricers * failing test for accrual * pricers * test * spaces * addressed review comments * error message
* Adding Inauguration Day to MXMC * Adding Inauguration Day to MXMC * Adding Inauguration Day to MXMC
Co-authored-by: Michael Rollins <MichaelRol@users.noreply.github.com>
* Adding Overnight-Overnight swap conventions * Cleanup + Add Tests * PR cleanup * Finish PR feedback * Fix tests * Make constant public to fix ini loading --------- Co-authored-by: Brian Weller <brianweller89@users.noreply.github.com>
* Holiday for President Jimmy Carter * Only appears to apply to NYSE * https://www.sifma.org/resources/unscheduled-close-market-matrix/ * Fixes #2691
Bumps [com.google.guava:guava](https://github.com/google/guava) from 32.1.3-jre to 33.4.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.2 to 5.11.4. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](junit-team/junit-framework@r5.11.2...r5.11.4) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.3 to 3.27.0. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](assertj/assertj@assertj-build-3.25.3...assertj-build-3.27.0) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Provide default value for new property * Adjust code to pull out events per year
|
The year 2025 starts very nicely. Thank you for reviewing my modifications. |
|
There are other lines where the logic should be changed:
In fact everty time there is a "++pow" There is also this odd/ugly name function I can fix my PR with some guidance. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Irregular-period handling is not propagated to AD, duration, and convexity calculations, producing inconsistent sensitivities.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Fixes yield pricing for bonds with irregular coupon periods by tracking period regularity and applying fractional-period discounting.
Changes:
- Adds and resolves coupon-period regularity metadata.
- Updates dirty-price discount factors for irregular periods.
- Adds day-count and irregular-schedule regression tests.
| File | Description |
|---|---|
FixedCouponBondPaymentPeriod.java |
Adds the regular property. |
FixedCouponBond.java |
Populates regularity during resolution. |
DiscountingFixedCouponBondProductPricer.java |
Applies fractional-period discounting. |
DiscountingFixedCouponBondProductPricerTest.java |
Adds yield regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (period.isRegular()) { | ||
| factor *= factorOnPeriod; | ||
| } else { | ||
| factor *= Math.pow(factorOnPeriod, yearFraction * eventsPerYear); |
| double dirtyPrice = PRICER.dirtyPriceFromCleanPrice(bond, settlementDate, cleanPrice); | ||
| assertThat(dirtyPrice).isCloseTo(cleanPrice, offset(TOL)); // 2.x. | ||
| double yield = PRICER.yieldFromDirtyPrice(bond, settlementDate, dirtyPrice); | ||
| assertThat(yield).isCloseTo(0.07286881667273096, offset(TOL)); // 2.x.œœ |
| /** | ||
| * Indicates if the is period is regular. | ||
| * <p> | ||
| * If true the full coupon is paid, otherwise the period is shorter/longer. |
Merge Queue Status
This pull request spent 10 minutes 29 seconds in the queue, including 10 minutes 7 seconds running CI. Required conditions to merge
|


Updated code from #2655. Applies a fix to
dirtyPriceFromYieldStandardforFixedCouponBond.The main change is the use of
Math.pow(factorOnPeriod, yearFraction * eventsPerYear)instead offactorOnPeriodwhen the period is not regular.