Package com.opengamma.analytics.financial.instrument.inflation

Examples of com.opengamma.analytics.financial.instrument.inflation.CapFloorInflationZeroCouponInterpolationDefinition


    final ZonedDateTime paymentDate = ScheduleCalculator.getAdjustedDate(settleDate, Period.ofYears(tenorYear), BUSINESS_DAY, CALENDAR_USD, USDLIBOR3M.isEndOfMonth());
    final double weightSettle = 1.0 - (paymentDate.getDayOfMonth() - 1.0) / paymentDate.toLocalDate().lengthOfMonth();
    final double indexStart = weightSettle * 225.964 + (1 - weightSettle) * 225.722;
    final CouponInflationZeroCouponInterpolationDefinition zeroCouponUsdDefinition = CouponInflationZeroCouponInterpolationDefinition.from(settleDate, paymentDate, notional, PRICE_INDEX_US,
        MONTH_LAG, MONTH_LAG, false);
    final CapFloorInflationZeroCouponInterpolationDefinition capZeroCouponUsdDefinition = CapFloorInflationZeroCouponInterpolationDefinition.from(zeroCouponUsdDefinition,
        LAST_KNOWN_FIXING_DATE, MATURITY, STRIKE, IS_CAP);

    final ZonedDateTimeDoubleTimeSeries ts = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(
        new ZonedDateTime[] {DateUtils.getUTCDate(2008, 4, 30), DateUtils.getUTCDate(2008, 5, 31), DateUtils.getUTCDate(2011, 5, 31), DateUtils.getUTCDate(2011, 6, 30),
          DateUtils.getUTCDate(2011, 9, 27),
          DateUtils.getUTCDate(2011, 9, 28) }, new double[] {108.23, 108.64, 225.964, 225.722, 200, 200 });

    final CapFloorInflationZeroCouponInterpolation capZeroCouponUsd = (CapFloorInflationZeroCouponInterpolation) capZeroCouponUsdDefinition.toDerivative(PRICING_DATE, ts);
    final CouponInflationZeroCouponInterpolation zeroCouponUsd = (CouponInflationZeroCouponInterpolation) zeroCouponUsdDefinition.toDerivative(PRICING_DATE, ts);
    final MultipleCurrencyAmount pvInflation = METHOD.presentValue(capZeroCouponUsd, blackInflation);
    final double df = marketSeason.getCurve(zeroCouponUsd.getCurrency()).getDiscountFactor(zeroCouponUsd.getPaymentTime());
    final double indexMonth0 = marketSeason.getCurve(PRICE_INDEX_US).getPriceIndex(zeroCouponUsd.getReferenceEndTime()[0]);
    final double indexMonth1 = marketSeason.getCurve(PRICE_INDEX_US).getPriceIndex(zeroCouponUsd.getReferenceEndTime()[1]);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.instrument.inflation.CapFloorInflationZeroCouponInterpolationDefinition

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.