Examples of StubType


Examples of com.opengamma.financial.convention.StubType

    final double recoveryRate = testCase.getRecoveryRate();

    // Assume 1 billion notional, quarterly premiums and ACT360 day count
    final double notional = 1000000000;
    final Frequency couponFrequency = SimpleFrequency.QUARTERLY;
    final StubType stubType = StubType.SHORT_START;

    // Now build the CDS object
    final ISDACDSPremiumDefinition premiumDefinition = ISDACDSPremiumDefinition.from(startDate, maturity, couponFrequency, convention, stubType, /* protect start */ true, /*notional*/ 1.0, spread, Currency.EUR, calendar);
    final ISDACDSDefinition cdsDefinition = new ISDACDSDefinition(startDate, maturity, premiumDefinition, /*notional*/1.0, spread, recoveryRate, /* accrualOnDefault */ true, /* payOnDefault */ true, /* protectStart */ true, couponFrequency, convention, stubType);
    final ISDACDSDerivative cds = cdsDefinition.toDerivative(pricingDate, stepinDate, settlementDate, "IR_CURVE");
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    final DayCount dayCount = new ActualThreeSixty();
    final BusinessDayConvention businessDays = new FollowingBusinessDayConvention();
    final Convention convention = new Convention(settlementDays, dayCount, businessDays, calendar, "");

    final StubType stubType = StubType.SHORT_START;

    // Include the accrued coupon (for a default that occurs between coupon dates)
    final boolean accrualOnDefault = true;

    // Pay contingent leg on default or at maturity?
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborFromStandard() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 9, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2);
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborDefinition> leg = AnnuityDefinitionBuilder.annuityIborFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL,
        USDLIBOR6M, true, USDLIBOR6M.getBusinessDayConvention(), USDLIBOR6M.isEndOfMonth(), USDLIBOR6M.getDayCount(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2014, 3, 20), DateUtils.getUTCDate(2014, 9, 22),
      DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Spread", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborFromShortFirst() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 8, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2).plusMonths(1); // 2Y 1M
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborDefinition> leg = AnnuityDefinitionBuilder.annuityIborFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL,
        USDLIBOR6M, true, USDLIBOR6M.getBusinessDayConvention(), USDLIBOR6M.isEndOfMonth(), USDLIBOR6M.getDayCount(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2013, 9, 20), DateUtils.getUTCDate(2014, 3, 20),
      DateUtils.getUTCDate(2014, 9, 22), DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Spread", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborSpreadFromStandard() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 9, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2);
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborSpreadDefinition> leg = AnnuityDefinitionBuilder.annuityIborSpreadFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL, SPREAD,
        USDLIBOR6M, true, USDLIBOR6M.getBusinessDayConvention(), USDLIBOR6M.isEndOfMonth(), USDLIBOR6M.getDayCount(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2014, 3, 20), DateUtils.getUTCDate(2014, 9, 22),
      DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Spread", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborCompoundingFromStandard() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 9, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2);
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborCompoundingDefinition> leg = AnnuityDefinitionBuilder.annuityIborCompoundingFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL,
        USDLIBOR3M, stub, true, USDLIBOR3M.getBusinessDayConvention(), USDLIBOR3M.isEndOfMonth(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2014, 3, 20), DateUtils.getUTCDate(2014, 9, 22),
      DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Compounding", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborCompoundingSpreadFromStandard() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 9, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2);
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborCompoundingSpreadDefinition> leg = AnnuityDefinitionBuilder.annuityIborCompoundingSpreadFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL, SPREAD,
        USDLIBOR3M, stub, true, USDLIBOR3M.getBusinessDayConvention(), USDLIBOR3M.isEndOfMonth(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2014, 3, 20), DateUtils.getUTCDate(2014, 9, 22),
      DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Spread", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

  @Test
  public void annuityIborCompoundingFlatSpreadFromStandard() {
    ZonedDateTime settlementDate = DateUtils.getUTCDate(2013, 9, 20);
    ZonedDateTime maturityDate = settlementDate.plusYears(2);
    Period paymentPeriod = Period.ofMonths(6);
    final StubType stub = StubType.SHORT_START;
    AnnuityDefinition<CouponIborCompoundingFlatSpreadDefinition> leg = AnnuityDefinitionBuilder.annuityIborCompoundingFlatSpreadFrom(settlementDate, maturityDate, paymentPeriod, NOTIONAL, SPREAD,
        USDLIBOR3M, stub, true, USDLIBOR3M.getBusinessDayConvention(), USDLIBOR3M.isEndOfMonth(), NYC, stub);
    ZonedDateTime[] expectedPaymentDates = new ZonedDateTime[] {DateUtils.getUTCDate(2014, 3, 20), DateUtils.getUTCDate(2014, 9, 22),
      DateUtils.getUTCDate(2015, 3, 20), DateUtils.getUTCDate(2015, 9, 21) };
    assertEquals("AnnuityDefinitionBuilder: Coupon Ibor Spread", expectedPaymentDates.length, leg.getNumberOfPayments());
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    final Frequency premiumFrequency = SimpleFrequency.QUARTERLY;
    final Calendar calendar = new MondayToFridayCalendar("TestCalendar");
    final DayCount dayCount = new ActualThreeSixty();
    final BusinessDayConvention businessDays = new FollowingBusinessDayConvention();
    final Convention convention = new Convention(settlementDays, dayCount, businessDays, calendar, "");
    final StubType stubType = StubType.SHORT_START;

    final ISDACDSPremiumDefinition premiumDefinition = ISDACDSPremiumDefinition.from(startDate, maturity, premiumFrequency, convention, stubType, /* protectStart */ true, notional, spread, Currency.EUR, calendar);

    return new ISDACDSDefinition(startDate, maturity, premiumDefinition, notional, spread, recoveryRate, /* accrualOnDefault */ true, /* payOnDefault */ true, /* protectStart */ true, premiumFrequency, convention, stubType);
  }
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    final Frequency couponFrequency = SimpleFrequency.QUARTERLY;
    final Calendar calendar = new MondayToFridayCalendar("TestCalendar");
    final DayCount dayCount = new ActualThreeSixty();
    final BusinessDayConvention businessDays = new FollowingBusinessDayConvention();
    final Convention convention = new Convention(settlementDays, dayCount, businessDays, calendar, "");
    final StubType stubType = StubType.SHORT_START;

    final ISDACDSPremiumDefinition premiumDefinition = ISDACDSPremiumDefinition.from(startDate, maturity, couponFrequency, convention, stubType, /* protectStart */ true, notional, spread, Currency.EUR, calendar);

    return new ISDACDSDefinition(startDate, maturity, premiumDefinition, notional, spread, recoveryRate, /* accrualOnDefault */ true, /* payOnDefault */ true, /* protectStart */ true, couponFrequency, convention, stubType);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.