Package com.opengamma.analytics.financial.instrument.index

Examples of com.opengamma.analytics.financial.instrument.index.IndexON


        ConstantDoublesCurve.from(0.03, "c"));
    ibor.put(new IborIndex(Currency.EUR, Period.ofMonths(6), 1, DayCountFactory.INSTANCE.getDayCount("Act/360"),
        BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), false, "D"),
        ConstantDoublesCurve.from(0.03, "d"));
    final Map<IndexON, YieldAndDiscountCurve> overnight = new LinkedHashMap<>();
    overnight.put(new IndexON("NAME1", Currency.USD, DayCountFactory.INSTANCE.getDayCount("Act/360"), 1), new YieldCurve("E", ConstantDoublesCurve.from(0.003, "e")));
    overnight.put(new IndexON("NAME2", Currency.EUR, DayCountFactory.INSTANCE.getDayCount("Act/360"), 0), new YieldCurve("F", ConstantDoublesCurve.from(0.006, "f")));
    final MulticurveProviderForward provider = new MulticurveProviderForward(discounting, ibor, overnight, matrix);
    assertEquals(provider, cycleObject(MulticurveProviderForward.class, provider));
  }
View Full Code Here


        new YieldCurve("C", ConstantDoublesCurve.from(0.03, "c")));
    ibor.put(new IborIndex(Currency.EUR, Period.ofMonths(6), 1, DayCountFactory.INSTANCE.getDayCount("Act/360"),
        BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), false, "P"),
        new YieldCurve("D", ConstantDoublesCurve.from(0.03, "d")));
    final Map<IndexON, YieldAndDiscountCurve> overnight = new LinkedHashMap<>();
    overnight.put(new IndexON("NAME1", Currency.USD, DayCountFactory.INSTANCE.getDayCount("Act/360"), 1), new YieldCurve("E", ConstantDoublesCurve.from(0.003, "e")));
    overnight.put(new IndexON("NAME2", Currency.EUR, DayCountFactory.INSTANCE.getDayCount("Act/360"), 0), new YieldCurve("F", ConstantDoublesCurve.from(0.006, "f")));
    final MulticurveProviderDiscount provider = new MulticurveProviderDiscount(discounting, ibor, overnight, matrix);
    final Map<IndexPrice, PriceIndexCurve> curves = new LinkedHashMap<>();
    curves.put(new IndexPrice("CPI1", Currency.USD), new PriceIndexCurve(ConstantDoublesCurve.from(0.02, "A")));
    curves.put(new IndexPrice("CPI2", Currency.EUR), new PriceIndexCurve(ConstantDoublesCurve.from(0.03, "B")));
    final InflationProviderDiscount inflation = new InflationProviderDiscount(provider, curves);
View Full Code Here

        new YieldCurve("C", ConstantDoublesCurve.from(0.03, "c")));
    ibor.put(new IborIndex(Currency.EUR, Period.ofMonths(6), 1, DayCountFactory.INSTANCE.getDayCount("Act/360"),
        BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), false, "P"),
        new YieldCurve("D", ConstantDoublesCurve.from(0.03, "d")));
    final Map<IndexON, YieldAndDiscountCurve> overnight = new LinkedHashMap<>();
    overnight.put(new IndexON("NAME1", Currency.USD, DayCountFactory.INSTANCE.getDayCount("Act/360"), 1), new YieldCurve("E", ConstantDoublesCurve.from(0.003, "e")));
    overnight.put(new IndexON("NAME2", Currency.EUR, DayCountFactory.INSTANCE.getDayCount("Act/360"), 0), new YieldCurve("F", ConstantDoublesCurve.from(0.006, "f")));
    final MulticurveProviderDiscount provider = new MulticurveProviderDiscount(discounting, ibor, overnight, matrix);
    final Map<Pair<String, Currency>, YieldAndDiscountCurve> curves = new HashMap<>();
    curves.put(Pair.of("E", Currency.USD), new YieldCurve("L", ConstantDoublesCurve.from(0.1234, "l")));
    curves.put(Pair.of("F", Currency.EUR), new YieldCurve("P", ConstantDoublesCurve.from(0.1234, "p")));
    final IssuerProviderDiscount issuer = new IssuerProviderDiscount(provider, curves);
View Full Code Here

        new YieldCurve("C", ConstantDoublesCurve.from(0.03, "c")));
    ibor.put(new IborIndex(Currency.EUR, Period.ofMonths(6), 1, DayCountFactory.INSTANCE.getDayCount("Act/360"),
        BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), false, "U"),
        new YieldCurve("D", ConstantDoublesCurve.from(0.03, "d")));
    final Map<IndexON, YieldAndDiscountCurve> overnight = new LinkedHashMap<>();
    overnight.put(new IndexON("NAME1", Currency.USD, DayCountFactory.INSTANCE.getDayCount("Act/360"), 1), new YieldCurve("E", ConstantDoublesCurve.from(0.003, "e")));
    overnight.put(new IndexON("NAME2", Currency.EUR, DayCountFactory.INSTANCE.getDayCount("Act/360"), 0), new YieldCurve("F", ConstantDoublesCurve.from(0.006, "f")));
    final MulticurveProviderDiscount multicurve = new MulticurveProviderDiscount(discounting, ibor, overnight, matrix);
    final HullWhiteOneFactorPiecewiseConstantParameters parameters = new HullWhiteOneFactorPiecewiseConstantParameters(0.04, new double[] {0.1, 0.2, 0.3, 0.4, 0.5}, new double[] {1, 2, 3, 4, 5});
    final HullWhiteOneFactorProviderDiscount provider = new HullWhiteOneFactorProviderDiscount(multicurve, parameters, Currency.USD);
    assertEquals(provider, cycleObject(HullWhiteOneFactorProviderDiscount.class, provider));
  }
View Full Code Here

    final CouponArithmeticAverageONSpreadDefinition other = CouponArithmeticAverageONSpreadDefinition.from(FEDFUND, EFFECTIVE_DATE, TENOR_3M, NOTIONAL, PAYMENT_LAG,
        MOD_FOL, true, SPREAD, NYC);
    assertEquals("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF, other);
    assertEquals("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.hashCode(), other.hashCode());
    CouponArithmeticAverageONSpreadDefinition modified;
    final IndexON modifiedIndex = IndexONMaster.getInstance().getIndex("EONIA");
    modified = CouponArithmeticAverageONSpreadDefinition.from(modifiedIndex, EFFECTIVE_DATE, TENOR_3M, NOTIONAL, PAYMENT_LAG, MOD_FOL, true, SPREAD, NYC);
    assertFalse("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.equals(modified));
    modified = CouponArithmeticAverageONSpreadDefinition.from(FEDFUND, EFFECTIVE_DATE.plusDays(1), ACCRUAL_END_DATE_3M, NOTIONAL, PAYMENT_LAG, SPREAD, NYC);
    assertFalse("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.equals(modified));
    modified = CouponArithmeticAverageONSpreadDefinition.from(FEDFUND, EFFECTIVE_DATE, ACCRUAL_END_DATE_3M.plusDays(1), NOTIONAL, PAYMENT_LAG, SPREAD, NYC);
View Full Code Here

        FEDFUND_CPN_3M_2_DEF.getFixingPeriodAccrualFactors(), ACCRUED_RATE, SPREAD);
    assertFalse("CouponArithmeticAverageONSpread: equal-hash", CPN_AA_ON.equals(modified));
    modified = CouponArithmeticAverageONSpread.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL + 10, FEDFUND, FIXING_TIMES,
        FEDFUND_CPN_3M_2_DEF.getFixingPeriodAccrualFactors(), ACCRUED_RATE, SPREAD);
    assertFalse("CouponArithmeticAverageONSpread: equal-hash", CPN_AA_ON.equals(modified));
    final IndexON modifiedIndex = IndexONMaster.getInstance().getIndex("EONIA");
    modified = CouponArithmeticAverageONSpread.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL, modifiedIndex, FIXING_TIMES,
        FEDFUND_CPN_3M_2_DEF.getFixingPeriodAccrualFactors(), ACCRUED_RATE, SPREAD);
    assertFalse("CouponArithmeticAverageONSpread: equal-hash", CPN_AA_ON.equals(modified));
    modified = CouponArithmeticAverageONSpread.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL, FEDFUND, FIXING_TIMES, FEDFUND_CPN_3M_2_DEF.getFixingPeriodAccrualFactors(),
        ACCRUED_RATE + 0.1, SPREAD);
View Full Code Here

    final CouponArithmeticAverageONSpreadSimplifiedDefinition other = CouponArithmeticAverageONSpreadSimplifiedDefinition.from(FEDFUND, ACCRUAL_START_DATE, TENOR_3M,
        NOTIONAL, PAYMENT_LAG, MOD_FOL, true, SPREAD, NYC);
    assertEquals("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF, other);
    assertEquals("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.hashCode(), other.hashCode());
    CouponArithmeticAverageONSpreadSimplifiedDefinition modified;
    final IndexON modifiedIndex = IndexONMaster.getInstance().getIndex("EONIA");
    modified = CouponArithmeticAverageONSpreadSimplifiedDefinition.from(modifiedIndex, ACCRUAL_START_DATE, TENOR_3M, NOTIONAL, PAYMENT_LAG, MOD_FOL, true, SPREAD, NYC);
    assertFalse("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.equals(modified));
    modified = CouponArithmeticAverageONSpreadSimplifiedDefinition.from(FEDFUND, ACCRUAL_START_DATE.plusDays(1), TENOR_3M, NOTIONAL, PAYMENT_LAG, MOD_FOL, true, SPREAD, NYC);
    assertFalse("CouponArithmeticAverageON: equal-hash", FEDFUND_CPN_3M_DEF.equals(modified));
    modified = new CouponArithmeticAverageONSpreadSimplifiedDefinition(Currency.USD, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE.plusDays(1), ACCURAL_FACTOR, NOTIONAL, FEDFUND, SPREAD);
View Full Code Here

    final CouponONSpreadSimplifiedDefinition other = new CouponONSpreadSimplifiedDefinition(EUR_CUR, PAYMENT_DATE, START_ACCRUAL_DATE, END_ACCRUAL_DATE, PAYMENT_ACCRUAL_FACTOR, NOTIONAL, EUR_OIS,
        START_ACCRUAL_DATE, END_ACCRUAL_DATE, FIXING_YEAR_FRACTION, SPREAD);
    assertEquals("CouponOISSimplified definition: equal/hash code", EONIA_COUPON_DEFINITION, other);
    assertEquals("CouponOISSimplified definition: equal/hash code", EONIA_COUPON_DEFINITION.hashCode(), other.hashCode());
    CouponONSpreadSimplifiedDefinition modified;
    modified = new CouponONSpreadSimplifiedDefinition(EUR_CUR, PAYMENT_DATE, START_ACCRUAL_DATE, END_ACCRUAL_DATE, PAYMENT_ACCRUAL_FACTOR, NOTIONAL, new IndexON(EUR_OIS_NAME, EUR_CUR, EUR_DAY_COUNT,
        1),
        START_ACCRUAL_DATE, END_ACCRUAL_DATE, FIXING_YEAR_FRACTION, SPREAD);
    assertFalse("CouponOISSimplified definition: equal/hash code", EONIA_COUPON_DEFINITION.equals(modified));
    modified = new CouponONSpreadSimplifiedDefinition(EUR_CUR, PAYMENT_DATE, START_ACCRUAL_DATE, END_ACCRUAL_DATE, PAYMENT_ACCRUAL_FACTOR, NOTIONAL, EUR_OIS, END_ACCRUAL_DATE, END_ACCRUAL_DATE,
        FIXING_YEAR_FRACTION, SPREAD);
View Full Code Here

              final OvernightCurveTypeConfiguration overnight = (OvernightCurveTypeConfiguration) type;
              final OvernightIndexConvention overnightConvention = conventionSource.getConvention(OvernightIndexConvention.class, overnight.getConvention());
              if (overnightConvention == null) {
                throw new OpenGammaRuntimeException("Overnight convention called " + overnight.getConvention() + " was null");
              }
              overnightIndex.add(new IndexON(overnightConvention.getName(), overnightConvention.getCurrency(), overnightConvention.getDayCount(), overnightConvention.getPublicationLag()));
            } else if (type instanceof IssuerCurveTypeConfiguration) {
              final IssuerCurveTypeConfiguration issuer = (IssuerCurveTypeConfiguration) type;
              final String issuerName = issuer.getIssuerName();
              final Currency currency = Currency.of(issuer.getUnderlyingReference());
              issuerMap.put(curveName, Pair.of(issuerName, currency));
View Full Code Here

              final OvernightCurveTypeConfiguration overnight = (OvernightCurveTypeConfiguration) type;
              final OvernightIndexConvention overnightConvention = conventionSource.getConvention(OvernightIndexConvention.class, overnight.getConvention());
              if (overnightConvention == null) {
                throw new OpenGammaRuntimeException("Overnight convention called " + overnight.getConvention() + " was null");
              }
              overnightIndex.add(new IndexON(overnightConvention.getName(), overnightConvention.getCurrency(), overnightConvention.getDayCount(), overnightConvention.getPublicationLag()));
            } else {
              throw new OpenGammaRuntimeException("Cannot handle " + type.getClass());
            }
          } // type - end
          if (!iborIndex.isEmpty()) {
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.instrument.index.IndexON

Copyright © 2018 www.massapicom. 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.