I get a following exception at times:
Exception thrown:
com.opengamma.strata.basics.schedule.ScheduleException: Dates specify an explicit final stub, but stub convention is 'ShortInitial’
at com.opengamma.strata.basics.schedule.StubConvention$2.toImplicit(StubConvention.java:89)
at com.opengamma.strata.basics.schedule.PeriodicSchedule.generateImplicitStubConvention(PeriodicSchedule.java:560)
at com.opengamma.strata.basics.schedule.PeriodicSchedule.generateUnadjustedDates(PeriodicSchedule.java:546)
at com.opengamma.strata.basics.schedule.PeriodicSchedule.createSchedule(PeriodicSchedule.java:416)
at com.opengamma.strata.product.bond.FixedCouponBond.resolve(FixedCouponBond.java:167)
Failure input examples:
could not resolve fixed bond 2015-03-05, 2055-02-26, 2017-10-05
could not resolve fixed bond 2012-11-29, 2019-11-29, 2017-10-05
could not resolve fixed bond 2009-06-08, 2019-06-28, 2017-10-05
My code is as follows:
BusinessDayAdjustment businessDayAdj =
BusinessDayAdjustment.of(BusinessDayConventions.MODIFIED_FOLLOWING, HolidayCalendarIds.USNY);
PeriodicSchedule accrualSchedule = PeriodicSchedule
.builder()
.startDate(issueDate)
.endDate(maturityDate)
.lastRegularEndDate(maturityDate)
.businessDayAdjustment(businessDayAdj)
.frequency(Frequency.P6M)
.stubConvention(StubConvention.SHORT_INITIAL)
.rollConvention(RollConventions.EOM)
.build();
Any clarification or guidance would be much appreciated, thanks.