Package com.opengamma.analytics.financial.model.option.definition

Examples of com.opengamma.analytics.financial.model.option.definition.YieldCurveWithBlackCubeBundle


  @Override
  public YieldCurveWithBlackCubeBundle rollDown(final YieldCurveWithBlackCubeBundle data, final double time) {
    final YieldCurveBundle shiftedCurves = CURVES_ROLLDOWN.rollDown(data, time);
    final Surface<Double, Double, Double> surface = data.getBlackParameters();
    final Surface<Double, Double, Double> shiftedVolatilitySurface = SURFACE_ROLLDOWN.rollDown(surface, time);
    return new YieldCurveWithBlackCubeBundle(shiftedVolatilitySurface, shiftedCurves);
  }
View Full Code Here


    // Compute value at horizon
    final double valueHorizon;
    if (horizon.isBefore(definition.getUnderlyingOption().getExpirationDate())) {
      final InstrumentDerivative instrumentHorizon = definition.toDerivative(horizon, lastMarginPrice, yieldCurveNames);
      final YieldCurveWithBlackCubeBundle tomorrowData = IR_FUTURE_OPTION_ROLLDOWN.rollDown(data, shiftTime);
      valueHorizon = instrumentHorizon.accept(pvCalculator, tomorrowData);
    } else {
      valueHorizon = 0.0;
    }
View Full Code Here

  @Override
  public SurfaceValue visitInterestRateFutureOptionMarginTransaction(final InterestRateFutureOptionMarginTransaction transaction, final YieldCurveBundle curves) {
    Validate.notNull(transaction);
    Validate.notNull(curves);
    if (curves instanceof YieldCurveWithBlackCubeBundle) {
      final YieldCurveWithBlackCubeBundle curvesBlack = (YieldCurveWithBlackCubeBundle) curves;
      return METHOD_OPTIONFUTURESMARGIN_BLACK.presentValueBlackSensitivity(transaction, curvesBlack);
    }
    throw new UnsupportedOperationException("The PresentValueBlackSensitivityBlackCalculator visitor visitInterestRateFutureOptionMarginTransaction requires a YieldCurveWithBlackCubeBundle as data.");
  }
View Full Code Here

    curves.setCurve(FORWARD_CURVE_NAME, CURVE_45);
    return curves;
  }

  public static YieldCurveWithBlackCubeBundle createCubesBondFutureOption() {
    return new YieldCurveWithBlackCubeBundle(BLACK_SURFACE_EXP_TEN, createCurvesBond());
  }
View Full Code Here

    curves.setCurve(FORWARD_CURVE_NAME, CURVE_45);
    return curves;
  }

  public static YieldCurveWithBlackCubeBundle createCubesBondFutureOption() {
    return new YieldCurveWithBlackCubeBundle(BLACK_SURFACE_EXP_TEN, createCurvesBond());
  }
View Full Code Here

   * Test the option price Black sensitivity
   */
  public void priceBlackSensitivity() {
    final InterpolatedDoublesSurface blackParameterPlus = TestsDataSetsBlack.createBlackSurfaceExpiryStrikeShift(VOL_SHIFT);
    final InterpolatedDoublesSurface blackParameterMinus = TestsDataSetsBlack.createBlackSurfaceExpiryStrikeShift(-VOL_SHIFT);
    final YieldCurveWithBlackCubeBundle blackBundlePlus = new YieldCurveWithBlackCubeBundle(blackParameterPlus, CURVES);
    final YieldCurveWithBlackCubeBundle blackBundleMinus = new YieldCurveWithBlackCubeBundle(blackParameterMinus, CURVES);
    final double pricePlus = METHOD_SECURITY_OPTION_BLACK.optionPrice(OPTION_ERU2, blackBundlePlus);
    final double priceMinus = METHOD_SECURITY_OPTION_BLACK.optionPrice(OPTION_ERU2, blackBundleMinus);
    final double priceSensiExpected = (pricePlus - priceMinus) / (2 * VOL_SHIFT);
    final SurfaceValue priceSensiComputed = METHOD_SECURITY_OPTION_BLACK.priceBlackSensitivity(OPTION_ERU2, BLACK_BUNDLE);
    final DoublesPair point = new DoublesPair(OPTION_ERU2.getExpirationTime(), STRIKE);
View Full Code Here

    final int length = ts.getTimeSeries().size();
    if (length == 0) {
      throw new OpenGammaRuntimeException("Price time series for " + security.getUnderlyingId() + " was empty");
    }
    final double lastMarginPrice = ts.getTimeSeries().getLatestValue();
    final YieldCurveWithBlackCubeBundle data = new YieldCurveWithBlackCubeBundle(volatilitySurface.getSurface(), curves);

    final String daysForward = desiredValue.getConstraint(PROPERTY_DAYS_TO_MOVE_FORWARD);
    final ConstantSpreadHorizonThetaCalculator calculator = ConstantSpreadHorizonThetaCalculator.getInstance();
    final MultipleCurrencyAmount theta = calculator.getTheta((InterestRateFutureOptionMarginTransactionDefinition) irFutureOptionDefinition, now, fullCurveNames, data, lastMarginPrice,
        Integer.parseInt(daysForward));
View Full Code Here

    }
    final InstrumentDefinition<?> irFutureOptionDefinition = _converter.convert(trade);
    final InstrumentDerivative irFutureOption = _dataConverter.convert(security, irFutureOptionDefinition, now, fullCurveNames, timeSeries);
    final ValueProperties properties = getResultProperties(currency.getCode(), curveCalculationConfigName, surfaceName, curveName);
    final ValueSpecification spec = new ValueSpecification(_valueRequirementName, target.toSpecification(), properties);
    final YieldCurveWithBlackCubeBundle data = new YieldCurveWithBlackCubeBundle(volatilitySurface.getSurface(), curves);
    return getResult(irFutureOption, data, curveName, spec, security);
  }
View Full Code Here

    final double futurePrice = (Double) futurePriceObject;
    final InstrumentDefinition<?> bondFutureOptionDefinition = _converter.convert(trade);
    final BondFutureOptionPremiumTransaction bondFutureOption = (BondFutureOptionPremiumTransaction) _dataConverter.convert(security, bondFutureOptionDefinition, now, fullCurveNames, timeSeries);
    final ValueProperties properties = getResultProperties(desiredValue, security);
    final ValueSpecification spec = new ValueSpecification(_valueRequirementName, target.toSpecification(), properties);
    final YieldCurveWithBlackCubeBundle data = new YieldCurveWithBlackCubeBundle(getVolatilitySurface(volatilitySurface.getSurface(), callPrice, putPrice, futurePrice, bondFutureOption,
        curves), curves);
    return getResult(bondFutureOption, data, curveCalculationConfig, spec, inputs, desiredValues, security);
  }
View Full Code Here

      throw new OpenGammaRuntimeException("Expecting an InterpolatedDoublesSurface; got " + volatilitySurface.getSurface().getClass());
    }
    final InstrumentDefinition<?> irFutureOptionDefinition = _converter.convert(trade);
    final InstrumentDerivative irFutureOption = _dataConverter.convert(security, irFutureOptionDefinition, now, fullCurveNames, timeSeries);
    final ValueSpecification spec = new ValueSpecification(_valueRequirementName, target.toSpecification(), desiredValue.getConstraints());
    final YieldCurveWithBlackCubeBundle data = new YieldCurveWithBlackCubeBundle(volatilitySurface.getSurface(), curves);
    return getResult(irFutureOption, data, spec, desiredValues);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.option.definition.YieldCurveWithBlackCubeBundle

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.