Engine
Engine copied to clipboard
Allow negative paymentlag
This pull request incorporates modifications from QuantLib, enabling the handling of negative payment lags, as implemented in QuantLib PR #1818.
It is recommended to merge this pull request after updating ORE QuantLib with the corresponding changes.
There are still some places left where Natural payment lag is still being used in ORE but these where not changed and we are not certain they should allow a negative payment lag:
- EquityCoupon
- EquityMarginCoupon
- DurationAdjustedCMSCoupon
- FormulaBasedCoupon/Leg
Should we add to the user guide that there are exceptions for a negative payment lag?
Generally, all coupon types should support negative payment lag as long as the resulting payment date makes sense economically, i.e. the amount is fully determined before or on the payment date. But that's already the case for in arrears fixed term rates or the old ibor coupons.
In particular, DurationAdjustedCMSCoupon, FormulaBasedCoupon should support the feature, they are not different than any other coupon. The other two probably too, as long as the above restriction is fulfilled.
It's also generally desirable to have the same technical treatment in all coupon classes. They should throw an error instead if the resulting pay date does not make sense.
Does that make sense?