Skip to content

Commit

Permalink
make use of Calendar::businessDaysBetween()
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulXiCao committed Mar 4, 2024
1 parent 3a98413 commit 368c13b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test-suite/convertiblebonds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ struct CommonVars {
maturityDate = calendar.advance(issueDate, 10, Years);
// reset to avoid inconsistencies as the schedule is backwards
issueDate = calendar.advance(maturityDate, -10, Years);
fixingDays = 0;
for (Date d = today; d != issueDate; ++d)
if (calendar.isBusinessDay(d) && !calendar.isWeekend(d.weekday()))
++fixingDays;
fixingDays = calendar.businessDaysBetween(today, issueDate);

underlying.linkTo(ext::make_shared<SimpleQuote>(50.0));
dividendYield.linkTo(flatRate(today, 0.02, dayCounter));
Expand Down

0 comments on commit 368c13b

Please sign in to comment.