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

Don't set roll convention when creating accrual periods for CNY indices with 1W reset frequency. #2249

Merged
merged 3 commits into from Nov 4, 2020

Conversation

daminuk
Copy link
Contributor

@daminuk daminuk commented Nov 3, 2020

  • When considering CNY indices with a 1W reset frequency don't set the roll convention, this results in an appropriate weekly roll convention being selected for each sub-schedule.

@@ -319,7 +322,9 @@ public void collectIndices(ImmutableSet.Builder<Index> builder) {
// resolve against reference data once
DateAdjuster fixingDateAdjuster = fixingDateOffset.resolve(refData);
Function<SchedulePeriod, Schedule> resetScheduleFn =
getResetPeriods().map(rp -> rp.createSchedule(accrualSchedule.getRollConvention(), refData)).orElse(null);
getResetPeriods().map(rp -> getIndex().getCurrency().equals(CNY) && rp.getResetFrequency().equals(P1W) ?
Copy link
Member

Choose a reason for hiding this comment

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

I think we can be more general here. If accrualSchedule.getFrequency().isMonthBased() and rp.getResetFrequency().isWeekBased() then...

.currency(Currency.CNY)
.dayCount(ACT_365F)
.name("CNY-REPO-1W")
.fixingCalendar(SAT_SUN)
Copy link
Member

Choose a reason for hiding this comment

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

No idea what happens if there is a holiday. Maybe the test case should cover that?

@jodastephen jodastephen added the auto-merge Merge when build finishes label Nov 4, 2020
@mergify mergify bot merged commit 6ba9d0e into master Nov 4, 2020
4 checks passed
@delete-merged-branch delete-merged-branch bot deleted the topic/cny-1w branch November 4, 2020 13:03
@jodastephen jodastephen added this to the v2.9 milestone Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Merge when build finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants