Package com.opengamma.analytics.financial.model.interestrate.curve

Examples of com.opengamma.analytics.financial.model.interestrate.curve.ForwardCurve


    }
    final NodalDoublesCurve futurePriceData = (NodalDoublesCurve) objectFuturePriceData;

    final Interpolator1D interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator(interpolatorName, leftExtrapolatorName, rightExtrapolatorName);

    final ForwardCurve curve = new ForwardCurve(InterpolatedDoublesCurve.from(futurePriceData.getXData(), futurePriceData.getYData(), interpolator));

    final ValueProperties properties = createValueProperties()
        .with(ForwardCurveValuePropertyNames.PROPERTY_FORWARD_CURVE_CALCULATION_METHOD, ForwardCurveValuePropertyNames.PROPERTY_FUTURE_PRICE_METHOD)
        .with(ValuePropertyNames.CURVE, curveName)
        .with(ForwardCurveValuePropertyNames.PROPERTY_FORWARD_CURVE_INTERPOLATOR, interpolatorName)
View Full Code Here


    }
    final NodalDoublesCurve futurePriceData = (NodalDoublesCurve) objectFuturePriceData;

    final Interpolator1D interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator(interpolatorName, leftExtrapolatorName, rightExtrapolatorName);

    final ForwardCurve curve = new ForwardCurve(InterpolatedDoublesCurve.from(futurePriceData.getXData(), futurePriceData.getYData(), interpolator));

    final ValueProperties properties = createValueProperties()
        .with(ForwardCurveValuePropertyNames.PROPERTY_FORWARD_CURVE_CALCULATION_METHOD, ForwardCurveValuePropertyNames.PROPERTY_FUTURE_PRICE_METHOD)
        .with(ValuePropertyNames.CURVE, curveName)
        .with(ForwardCurveValuePropertyNames.PROPERTY_FORWARD_CURVE_INTERPOLATOR, interpolatorName)
View Full Code Here

    // 3. Forward Curve
    final Object forwardCurveObject = inputs.getValue(ValueRequirementNames.FORWARD_CURVE);
    if (forwardCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get forward curve");
    }
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    final StaticReplicationDataBundle market = new StaticReplicationDataBundle(blackVolSurf, discountingCurve, forwardCurve);
    return market;
  }
View Full Code Here

        .with(MultiYieldCurvePropertiesAndDefaults.PROPERTY_USE_FINITE_DIFFERENCE, "false")
        .get()), receiveCurveSpec,
        receiveCurveMarketData, receiveHtsConversion);
    // FXForwardCurveFromYieldCurveFunction
    target = new ComputationTarget(ComputationTargetType.UNORDERED_CURRENCY_PAIR, UnorderedCurrencyPair.of(payCurrency, receiveCurrency));
    final ForwardCurve fxForwardCurve = (ForwardCurve) execute(
        execContext,
        fxForwardCurveFromYieldCurveFunction,
        target,
        new ValueRequirement(ValueRequirementNames.FORWARD_CURVE, target.toSpecification(), ValueProperties.with(ValuePropertyNames.CURVE, getCurrencyCurveName()).get()),
        payCurve,
        receiveCurve,
        new ComputedValue(ValueSpecification.of(ValueRequirementNames.SPOT_RATE, ComputationTargetType.PRIMITIVE,
            UniqueId.of(spotRateIdentifier.getScheme().getName(), spotRateIdentifier.getValue()),
            ValueProperties.with(ValuePropertyNames.FUNCTION, "SPOT").get()), spotRate.getSecond())).getValue();
    double rate = fxForwardCurve.getForward(Period.between(spotRate.getFirst(), date).getDays() / YEAR_LENGTH);
    if (!FXUtils.isInBaseQuoteOrder(currencies.getFirst(), currencies.getSecond())) {
      rate = 1 / rate;
    }
    s_logger.debug("Calculated rate {} for {} on {}", new Object[] {rate, currencies, date });
    return rate;
View Full Code Here

    }
    final Object forwardCurveObject = inputs.getValue(forwardCurveRequirement);
    if (forwardCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + forwardCurveRequirement);
    }
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    @SuppressWarnings("unchecked")
    final VolatilitySurfaceData<Tenor, Pair<Number, FXVolQuoteType>> fxVolatilitySurface = (VolatilitySurfaceData<Tenor, Pair<Number, FXVolQuoteType>>) volatilitySurfaceObject;
    final Tenor[] tenors = fxVolatilitySurface.getXs();
    Arrays.sort(tenors);
    final Pair<Number, FXVolQuoteType>[] quotes = fxVolatilitySurface.getYs();
View Full Code Here

    }
    final Object forwardCurveObject = inputs.getValue(forwardCurveRequirement);
    if (forwardCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + forwardCurveRequirement);
    }
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    @SuppressWarnings("unchecked")
    final VolatilitySurfaceData<Tenor, Pair<Number, FXVolQuoteType>> fxVolatilitySurface = (VolatilitySurfaceData<Tenor, Pair<Number, FXVolQuoteType>>) volatilitySurfaceObject;
    final Tenor[] tenors = fxVolatilitySurface.getXs();
    Arrays.sort(tenors);
    final Pair<Number, FXVolQuoteType>[] quotes = fxVolatilitySurface.getYs();
View Full Code Here

    final Object discountingCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    if (discountingCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get discounting curve");
    }
    final LocalVolatilitySurfaceMoneyness localVolatility = (LocalVolatilitySurfaceMoneyness) localVolatilityObject;
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    final EuropeanVanillaOption option = getOption(security, now);
    final YieldAndDiscountCurve discountingCurve = (YieldAndDiscountCurve) discountingCurveObject;
    final Object result = getResult(pdeCalculator, localVolatility, forwardCurve, option, discountingCurve);
    final ValueProperties properties = getResultProperties(desiredValue);
    final ValueSpecification spec = new ValueSpecification(getRequirementName(), target.toSpecification(), properties);
View Full Code Here

    final Object discountingCurveObject = inputs.getValue(getDiscountingCurveRequirement(target, desiredValue));
    if (discountingCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get discounting curve");
    }
    final LocalVolatilitySurfaceMoneyness localVolatility = (LocalVolatilitySurfaceMoneyness) localVolatilityObject;
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    final EuropeanVanillaOption option = getOption(security, now);
    final YieldAndDiscountCurve discountingCurve = (YieldAndDiscountCurve) discountingCurveObject;
    final Object result = getResult(pdeCalculator, localVolatility, forwardCurve, option, discountingCurve);
    final ValueProperties properties = getResultProperties(desiredValue);
    final ValueSpecification spec = new ValueSpecification(getRequirementName(), target.toSpecification(), properties);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.interestrate.curve.ForwardCurve

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.