Cannot match yield for a GOC BOND with BBG


#1

I have a security with:
issue date: 2018 August 22
Maturity date: 2028 December 15
Coupon: 2.650

private static final DiscountingFixedCouponBondProductPricer PRICER = DiscountingFixedCouponBondProductPricer.DEFAULT;
private static final ResolvedFixedCouponBond _13509PGS6 = FixedCouponBond.builder()
	      .securityId(SecurityId.of(StandardId.of("CUSIP", "13509PGS6")))
	      .dayCount(DAY_COUNT)
	      .fixedRate(2.650 * 0.01)
	      .legalEntityId(ISSUER_ID)
	      .currency(Currency.CAD)
	      .notional(NOTIONAL)
	      .accrualSchedule(PeriodicSchedule.builder()
	          .startDate(LocalDate.of(2018, Month.AUGUST, 22))
	          .endDate(LocalDate.of(2028, Month.DECEMBER, 15))
	          .frequency(Frequency.P6M)
	          .businessDayAdjustment(BUSINESS_ADJUST) // BusinessDayConventions.FOLLOWING on US calendar
	          .stubConvention(StubConvention.SHORT_INITIAL)
	          .build())
	      .settlementDateOffset(SETTLEMENT_OFFSET)
	      .yieldConvention(YIELD_CONVENTION)
	      .build()
	      .resolve(REF_DATA);

for a settlement of November 5th, 2018, I expect a yield of 2.894 (BBG) but I get 2.872 for a price of 97.878.

	LocalDate settlementDate = LocalDate.of(2018, 11, 5);
	double dirtyPrice = PRICER.dirtyPriceFromCleanPrice(_13509PGS6, settlementDate, cleanPrice/100);
	double yield = PRICER.yieldFromDirtyPrice(_13509PGS6, settlementDate, dirtyPrice)*100;

First coupon is March 15, 2018.

Whan am I missing? If I adjust the start date to be First coupon minus 6 months, I get close to BBG up to 4th decimal place - but it doesn’t really make sense since the start date would be prior to the issue date - would it?
Out of ideas - :thinking:


#2

shouldn’t factorToNextCoupon return daysLeft/daysInQuasiCouponPeriod instead of (factorPeriod - factorSpot) / factorPeriod;?