Skip to content

Commit 43b6eb7

Browse files
JEAN-PROST Frédéricritonglue
authored andcommitted
Pricer-2592 use isRegular to compute the power of factorOnPeriod
1 parent ac68c66 commit 43b6eb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/pricer/src/main/java/com/opengamma/strata/pricer/bond/DiscountingFixedCouponBondProductPricer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,11 @@ private double dirtyPriceFromYieldStandard(
640640
first = false;
641641
factor = 1;
642642
} else {
643-
double delta = yearFraction * eventsPerYear;
644-
factor *= Math.pow(factorOnPeriod, delta);
643+
if (period.isIsRegular()) {
644+
factor *= factorOnPeriod;
645+
} else {
646+
factor *= Math.pow(factorOnPeriod, yearFraction * eventsPerYear);
647+
}
645648
}
646649
pvAtFirstCoupon += yearFraction / factor;
647650
}

0 commit comments

Comments
 (0)