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

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


    }
    final LocalDateDoubleTimeSeries localDateTS = ts.getTimeSeries();
    final DoubleTimeSeries<ZonedDateTime> priceIndexTimeSeries = convertTimeSeries(zone, localDateTS);
    final int conventionalMonthLag = inflationLegConvention.getMonthLag();
    final int monthLag = inflationLegConvention.getMonthLag();
    final IndexPrice index = new IndexPrice(priceIndexConvention.getName(), currency);
    switch (inflationNode.getInflationNodeType()) {
      case INTERPOLATED:
      {
        final CouponInflationZeroCouponInterpolationDefinition inflationCoupon = CouponInflationZeroCouponInterpolationDefinition.from(settlementDate, paymentDate,
            -notional, index, conventionalMonthLag, monthLag, false);
View Full Code Here


    @Override
    public IndexPrice buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String name = message.getString(NAME_FIELD);
      final Currency currency = Currency.of(message.getString(CURRENCY_FIELD));
      return new IndexPrice(name, currency);
    }
View Full Code Here

      final List<FudgeField> indexFields = message.getAllByName(PRICE_INDEX_FIELD);
      final List<FudgeField> indexCurveFields = message.getAllByName(PRICE_INDEX_CURVE_FIELD);
      final Map<IndexPrice, PriceIndexCurve> priceIndexCurves = new LinkedHashMap<>();
      final int n = indexFields.size();
      for (int i = 0; i < n; i++) {
        final IndexPrice index = deserializer.fudgeMsgToObject(IndexPrice.class, (FudgeMsg) indexFields.get(i).getValue());
        final PriceIndexCurve curve = deserializer.fudgeMsgToObject(PriceIndexCurve.class, (FudgeMsg) indexCurveFields.get(i).getValue());
        priceIndexCurves.put(index, curve);
      }
      return new InflationProviderDiscount(yieldCurves, priceIndexCurves);
    }
View Full Code Here

    }
    final InflationLegConvention inflationLegConvention = _conventionSource.getConvention(InflationLegConvention.class, getIds(currency, INFLATION_LEG));
    if (inflationLegConvention == null) {
      throw new OpenGammaRuntimeException("Inflation leg convention with id " + getIds(currency, INFLATION_LEG) + " was null");
    }
    final IndexPrice priceIndex = new IndexPrice(indexConvention.getName(), currency);
    final SwapLeg payLeg = security.getPayLeg();
    final SwapLeg receiveLeg = security.getReceiveLeg();
    final FixedInflationSwapLeg fixedLeg;
    final InflationIndexSwapLeg indexLeg;
    final boolean isPayer;
View Full Code Here

    }
    final InflationLegConvention inflationLegConvention = _conventionSource.getConvention(InflationLegConvention.class, getIds(currency, INFLATION_LEG));
    if (inflationLegConvention == null) {
      throw new OpenGammaRuntimeException("Inflation leg convention with id " + getIds(currency, INFLATION_LEG) + " was null");
    }
    final IndexPrice priceIndex = new IndexPrice(indexConvention.getName(), currency);
    final SwapLeg payLeg = security.getPayLeg();
    final SwapLeg receiveLeg = security.getReceiveLeg();
    final FixedInflationSwapLeg fixedLeg;
    final InflationIndexSwapLeg indexLeg;
    final boolean isPayer;
View Full Code Here

        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE.minusDays(1), MONTH_LAG, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT_START, WEIGHT_END, STRIKE, IS_CAP);
    assertFalse(YoY_CAP_DEFINITION.equals(modified));
    modified = new CapFloorInflationYearOnYearInterpolationDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE, MONTH_LAG - 1, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT_START, WEIGHT_END, STRIKE, IS_CAP);
    assertFalse(YoY_CAP_DEFINITION.equals(modified));
    final IndexPrice modifiedPriceIndex = new IndexPrice("US CPI x", Currency.USD);
    modified = new CapFloorInflationYearOnYearInterpolationDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, modifiedPriceIndex, LAST_KNOWN_FIXING_DATE, MONTH_LAG, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT_START, WEIGHT_END, STRIKE, IS_CAP);
    assertFalse(YoY_CAP_DEFINITION.equals(modified));
  }
View Full Code Here

        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE.minusDays(1), MONTH_LAG, 3, MATURITY, REFERENCE_START_DATES, REFERENCE_END_DATE, WEIGHT, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
    modified = new CapFloorInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE, MONTH_LAG - 1, 3, MATURITY, REFERENCE_START_DATES, REFERENCE_END_DATE, WEIGHT, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
    final IndexPrice modifiedPriceIndex = new IndexPrice("US CPI x", Currency.USD);
    modified = new CapFloorInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, modifiedPriceIndex, LAST_KNOWN_FIXING_DATE, MONTH_LAG, 3, MATURITY, REFERENCE_START_DATES, REFERENCE_END_DATE, WEIGHT, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
  }
View Full Code Here

        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE.minusDays(1), MONTH_LAG, 3, MATURITY, REFERENCE_START_DATE, REFERENCE_END_DATE, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
    modified = new CapFloorInflationZeroCouponMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE, MONTH_LAG - 1, 3, MATURITY, REFERENCE_START_DATE, REFERENCE_END_DATE, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
    final IndexPrice modifiedPriceIndex = new IndexPrice("US CPI x", Currency.USD);
    modified = new CapFloorInflationZeroCouponMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE,
        ACCRUAL_END_DATE, 1.0, NOTIONAL, modifiedPriceIndex, LAST_KNOWN_FIXING_DATE, MONTH_LAG, 3, MATURITY, REFERENCE_START_DATE, REFERENCE_END_DATE, STRIKE, IS_CAP);
    assertFalse(ZERO_COUPON_CAP_DEFINITION.equals(modified));
  }
View Full Code Here

    assertEquals(index, cycleObject(IndexON.class, index));
  }

  @Test
  public void testPriceIndex() {
    final IndexPrice index = new IndexPrice("ABC", Currency.ITL);
    assertEquals(index, cycleObject(IndexPrice.class, index));
  }
View Full Code Here

    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);
    assertEquals(inflation, cycleObject(InflationProviderDiscount.class, inflation));
  }
View Full Code Here

TOP

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

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.