-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FuturesRateHelper supplying reference dates for yearFraction computation #1829
Conversation
This PR was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks. |
#include <utility> | ||
|
||
#define APPLY_DATES(dates) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I did not miss something, you are always using this macro like
const FuturesRateHelperDates dates = InitializeDates(...);
APPLY_DATES(dates);
In this case it will be simpler to make InitializeDates
into private methods that directly set the fields. Then you don't need this macro and the FuturesRateHelperDates
struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use delegating constructors, the initialization code is no longer duplicated and can go in the constructors. I'll push the changes.
Closes #1163.
The
FuturesRateHelper
constructors calledyearFraction_ = dayCounter.yearFraction(earliestDate_, maturityDate_);
without supplying reference dates. Those are needed to compute annual payment frequency for "Actual/365 Canadian" day count convention.While working on this I factored out lots of repeated code within the constructors. Now the constructors are easier to understand and the actual fix for the issue can now be expressed as a one-line change.