-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
Hi!
With the new release, we found that trades where the accrual end date for the legs has passed but the payment date is still in the future relative to today, the notional is set to zero. The commit that introduced this is ba037a6, specifically the changes made to legdata.cpp on line 2649.
A crude way to solve it is to just add an additional check on the coupon payment date:
for (auto cf : leg) {
QuantLib::ext::shared_ptr<Coupon> coupon = QuantLib::ext::dynamic_pointer_cast<QuantLib::Coupon>(cf);
if ((coupon) && (coupon->accrualEndDate() > today || coupon->date() > today)) {
return coupon->nominal();
}
}Let me know what you think.
/Oskar
Metadata
Metadata
Assignees
Labels
No labels