Skip to content

Don't adjust explicit effective and termination dates to end of month - #1509

Merged
lballabio merged 5 commits into
lballabio:masterfrom
HristoRaykov:schedule_end_of_month
May 25, 2023
Merged

lballabio merged 5 commits into
lballabio:masterfrom
HristoRaykov:schedule_end_of_month

Conversation

@HristoRaykov

Copy link
Copy Markdown
Contributor

Schedule end of month adjustments removed for effective and termination dates as they are explicitly fixed. Fixes #1173

@boring-cyborg

boring-cyborg Bot commented Nov 1, 2022

Copy link
Copy Markdown

Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.

@CLAassistant

CLAassistant commented Nov 1, 2022 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Jan 1, 2023

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the stale label Jan 1, 2023
@lballabio lballabio removed the stale label Jan 1, 2023
@github-actions

github-actions Bot commented Mar 3, 2023

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the stale label Mar 3, 2023
@lballabio lballabio removed the stale label Mar 3, 2023
Comment thread ql/time/schedule.cpp Outdated
for (Size i=1; i<dates_.size()-1; ++i)
dates_[i] = Date::endOfMonth(dates_[i]);
} else {
dates_.front() = calendar_.adjust(dates_.front(), convention);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need the same check for DateGeneration::OldCDS as in the non-EOM branch...

Comment thread ql/time/schedule.cpp Outdated
if(d1 != d2) {
dates_.front() = d1;
dates_.back() = d2;
dates_.back() = calendar_.adjust(dates_.back(), terminationDateConvention);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and similarly this might need the checks for DateGeneration::CDS or DateGeneration::CDS2015.
If so, the adjustments for first date and last date would be the same and they could be moved out of the if/else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks are optimized as suggested.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage: 72.013% (-0.008%) from 72.021% when pulling 40231fb on HristoRaykov:schedule_end_of_month into a342b44 on lballabio:master.

@lballabio lballabio changed the title Schedule end of month Don't adjust explicit effective and termination dates to end of month May 25, 2023
@lballabio lballabio added this to the Release 1.31 milestone May 25, 2023
@lballabio
lballabio merged commit be7bdfb into lballabio:master May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ql.Schedule class 'endOfMonth'

4 participants