Explicit final stub issue

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.

(moved to the Strata category)

Can you be more precise about the input values that fail? I can’t connect the dates you’ve specified to the startDate, endDate etc.

The error basically means that lastRegularEndDate cannot be set with stubConvention = SHORT_INITIAL. The two are in conflict. Usually you specify one or the other. See also this documentation page.

Stephen

Hi Stephen,

Yes, apologies for my dates vagueness. The following is the order: issueDate, maturityDate and tradeDate. Although, the trade date doesn’t matter since I fail while creating the PeriodicSchedule object.

Thanks,
Nikola

Can you just leave out the lastRegularEndDate part of the builder? That should get you the answer you want.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.