/** * Vanilla swap builder from the settlement date, a swap generator and other details of a swap. * * @param settlementDate The settlement date. * @param maturityDate The swap maturity date. * @param generator The swap generator. * @param notionalFixed The fixed leg notional. * @param notionalIbor The ibor leg notional. * @param fixedRate The swap fixed rate. * @param isPayer The payer flag of the fixed leg. * @param calendar The holiday calendar for the ibor index. * @return The vanilla swap. */ public static SwapFixedIborDefinition from( final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final GeneratorSwapFixedIbor generator, final double notionalFixed, final double notionalIbor, final double fixedRate, final boolean isPayer, final Calendar calendar) { ArgumentChecker.notNull(settlementDate, "Settlement date"); ArgumentChecker.notNull(maturityDate, "Maturity date"); ArgumentChecker.notNull(generator, "Swap generator"); final AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from( generator.getCurrency(), settlementDate, maturityDate, generator.getFixedLegPeriod(), generator.getCalendar(), generator.getFixedLegDayCount(), generator.getIborIndex().getBusinessDayConvention(), generator.getIborIndex().isEndOfMonth(), notionalFixed, fixedRate, isPayer); final AnnuityCouponIborDefinition iborLeg = AnnuityCouponIborDefinition.from( settlementDate, maturityDate, notionalIbor, generator.getIborIndex(), !isPayer, calendar); return new SwapFixedIborDefinition(fixedLeg, iborLeg); }
static { LEGS_DEFINITION[0] = AnnuityDefinitionBuilder.couponFixed( EUR, SETTLEMENT_DATE, MATURITY_DATE, EUR1YEURIBOR6M.getFixedLegPeriod(), TARGET, EUR1YEURIBOR6M.getFixedLegDayCount(), EUR1YEURIBOR6M.getBusinessDayConvention(), EUR1YEURIBOR6M.isEndOfMonth(), NOTIONAL, SPREAD, IS_PAYER_SPREAD, STUB, 0); LEGS_DEFINITION[1] = AnnuityDefinitionBuilder.couponIbor( SETTLEMENT_DATE, MATURITY_DATE, EURIBOR3M.getTenor(), NOTIONAL, EURIBOR3M, IS_PAYER_SPREAD, EURIBOR3M.getDayCount(), EURIBOR3M.getBusinessDayConvention(), EURIBOR3M.isEndOfMonth(), TARGET, STUB, 0); LEGS_DEFINITION[2] = AnnuityDefinitionBuilder.couponIbor( SETTLEMENT_DATE, MATURITY_DATE, EURIBOR6M.getTenor(), NOTIONAL, EURIBOR6M, !IS_PAYER_SPREAD, EURIBOR6M.getDayCount(), EURIBOR6M.getBusinessDayConvention(), EURIBOR6M.isEndOfMonth(), TARGET, STUB, 0); }