Skip to content
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

Add smart stub conventions and switch to EOM #1829

Merged
merged 2 commits into from Oct 24, 2018

Conversation

Projects
None yet
2 participants
@jodastephen
Copy link
Member

jodastephen commented Oct 18, 2018

Add SmartInitial and SmartFinal conventions
Use SmartInitial instead of ShortInitial as the default
Enhance schedule builder to reduce chance of duplicate date errors
Change conventions to use SmartInitial and EOM

Add smart stub conventions and switch to EOM
Add `SmartInitial` and `SmartFinal` conventions
Use `SmartInitial` instead of `ShortInitial` as the default
Enhance schedule builder to reduce chance of duplicate date errors
Change conventions to use `SmartInitial` and 'EOM'
@@ -70,7 +70,7 @@ StubConvention toImplicit(PeriodicSchedule definition, boolean explicitInitialSt
/**
* A short initial stub.
* <p>
* The schedule periods will be determined backwards from the end date.
* The schedule periods will be determined backwards from the regular period end date.

This comment has been minimized.

Copy link
@brianweller89

brianweller89 Oct 24, 2018

Contributor

End date and regular period end date would be the same for initial stub?

This comment has been minimized.

Copy link
@jodastephen

jodastephen Oct 24, 2018

Author Member

Yes. The wording covers the case when there is a stub at both ends.

LocalDate explicitStartDate,
boolean explicitFinalStub,
LocalDate explicitEndDate) {

This comment has been minimized.

Copy link
@brianweller89

brianweller89 Oct 24, 2018

Contributor

explicitEndDate not used

if (stubConv.isCalculateBackwards()) {
if (stubCnv.isCalculateBackwards()) {
ArgChecker.isFalse(explicitInitStub, "Value explicitInitStub must be false");
ArgChecker.isFalse(explicitFinalStub, "Value explicitFinalStub must be false");

This comment has been minimized.

Copy link
@brianweller89

brianweller89 Oct 24, 2018

Contributor

Why are we having this restriction for backwards calculation only?

This comment has been minimized.

Copy link
@jodastephen

jodastephen Oct 24, 2018

Author Member

It drops out of logic elsewhere. When either of those flags are true we generate forwards.

*
* @return the roll convention, not null
*/
public RollConvention getRollConvention() {
return rollConvention != null ? rollConvention : RollConventions.NONE;
return rollConvention != null ? rollConvention : RollConventions.EOM;

This comment has been minimized.

Copy link
@brianweller89

brianweller89 Oct 24, 2018

Contributor

Why are we now defaulting to EOM? This is alot more restrictive in terms of which dates are acceptable?.

This comment has been minimized.

Copy link
@jodastephen

jodastephen Oct 24, 2018

Author Member

EOM means "prefer EOM". So it can still roll on the 5th or the 20th, its just that if the roll starts on the 30th November it will be treated as EOM instead of 30th.

@jodastephen jodastephen merged commit 02ebd57 into master Oct 24, 2018

14 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk - modules/basics/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/calc/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/collect/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/data/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/loader/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/market/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/math/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/measure/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/pricer/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/report/pom.xml (OpenGamma) No new issues
Details
security/snyk - pom.xml (OpenGamma) No new issues
Details

@jodastephen jodastephen deleted the topic/schedule-enhance branch Oct 24, 2018

@jodastephen jodastephen added this to the v2.1 milestone Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.