DV01 for fixed and zero coupon treasury bonds as well as DV01 for Fixed-Float swaps

One way to get the bond to start on 2016-05-16 but accrue from a day earlier is to use “overrideStartDate” and a stub convention as follows:

  private static final ResolvedFixedCouponBond _912828R36 = FixedCouponBond.builder()
      .securityId(SecurityId.of(StandardId.of("OG-Ticker", "912828R36")))
      .dayCount(DAY_COUNT)
      .fixedRate(1.625 * 0.01)
      .legalEntityId(ISSUER_ID)
      .currency(Currency.USD)
      .notional(NOTIONAL)
      .accrualSchedule(PeriodicSchedule.builder()
          .startDate(LocalDate.of(2016, 5, 16))
          .endDate(LocalDate.of(2026, 5, 15))
          .overrideStartDate(AdjustableDate.of(LocalDate.of(2016, 5, 15)))
          .frequency(Frequency.P6M)
          .businessDayAdjustment(BUSINESS_ADJUST)
          .stubConvention(StubConvention.SHORT_INITIAL)
          .build())
      .settlementDateOffset(DATE_OFFSET)
      .yieldConvention(YIELD_CONVENTION)
      .build()
      .resolve(REF_DATA);