findValue(row, leg, SPREAD_FIELD) .map(s -> LoaderUtils.parseDoublePercent(s)) .ifPresent(v -> builder.spread(ValueSchedule.of(v)));
iborRateBuilder.spread(parseSchedule(el, document)); });
public void test_toLeg_withSpread() { IborRateSwapLegConvention base = IborRateSwapLegConvention.builder() .index(GBP_LIBOR_3M) .build(); LocalDate startDate = LocalDate.of(2015, 5, 5); LocalDate endDate = LocalDate.of(2020, 5, 5); RateCalculationSwapLeg test = base.toLeg(startDate, endDate, PAY, NOTIONAL_2M, 0.25d); RateCalculationSwapLeg expected = RateCalculationSwapLeg.builder() .payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .frequency(P3M) .startDate(startDate) .endDate(endDate) .businessDayAdjustment(BDA_MOD_FOLLOW) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(P3M) .paymentDateOffset(DaysAdjustment.NONE) .build()) .notionalSchedule(NotionalSchedule.of(GBP, NOTIONAL_2M)) .calculation(IborRateCalculation.builder() .index(GBP_LIBOR_3M) .spread(ValueSchedule.of(0.25d)) .build()) .build(); assertEquals(test, expected); }
.index(EUR_EURIBOR_6M) .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, EUTA)) .spread(ValueSchedule.of(0.001)) .initialStub(IborRateStubCalculation.ofFixedRate(0.05125)) .finalStub(IborRateStubCalculation.ofIborRate(EUR_EURIBOR_3M))
.index(EUR_EURIBOR_3M) .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, CalendarUSD.NYC, BDA_P)) .spread(ValueSchedule.of(0.0020)) .build()) .build();
.index(EUR_EURIBOR_3M) .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, CalendarUSD.NYC, BDA_P)) .spread(ValueSchedule.of(0.0020)) .build()) .build();
.fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO)) .gearing(ValueSchedule.of(-1)) .spread(ValueSchedule.of(0.0325)) .build()) .build();
.fixingRelativeTo(getFixingRelativeTo()) .fixingDateOffset(getFixingDateOffset()) .spread(spread != 0 ? ValueSchedule.of(spread) : null) .build()) .build();
.index(USD_LIBOR_3M) .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, CalendarUSD.NYC, BDA_P)) .spread(ValueSchedule.of(0.0010)) .build()) .build();
.negativeRateMethod(NOT_NEGATIVE) .gearing(ValueSchedule.of(1d, ValueStep.of(2, ValueAdjustment.ofReplace(2d)))) .spread(ValueSchedule.of(0d, ValueStep.of(1, ValueAdjustment.ofReplace(-0.025d)))) .build(); RateAccrualPeriod rap1 = RateAccrualPeriod.builder(ACCRUAL1)
public void coverage() { IborRateCalculation test = IborRateCalculation.builder() .dayCount(ACT_365F) .index(GBP_LIBOR_3M) .fixingDateOffset(MINUS_TWO_DAYS) .build(); coverImmutableBean(test); IborRateCalculation test2 = IborRateCalculation.builder() .dayCount(ACT_360) .index(GBP_LIBOR_6M) .resetPeriods(ResetSchedule.builder() .resetFrequency(P3M) .resetMethod(IborRateResetMethod.UNWEIGHTED) .businessDayAdjustment(BusinessDayAdjustment.NONE) .build()) .fixingDateOffset(MINUS_THREE_DAYS) .fixingRelativeTo(PERIOD_END) .negativeRateMethod(NOT_NEGATIVE) .firstRegularRate(0.028d) .initialStub(IborRateStubCalculation.NONE) .finalStub(IborRateStubCalculation.NONE) .gearing(ValueSchedule.of(2d)) .spread(ValueSchedule.of(-0.025d)) .build(); coverBeanEquals(test, test2); }