Examples of YieldCurveWithBlackForexTermStructureBundle


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

   * @return The gamma.
   */
  public CurrencyAmount gamma(final ForexOptionVanilla optionForex, final YieldCurveBundle black, final boolean directQuote) {
    ArgumentChecker.notNull(black, "Curves");
    ArgumentChecker.isTrue(black instanceof YieldCurveWithBlackForexTermStructureBundle, "Yield curve bundle should contain smile data");
    final YieldCurveWithBlackForexTermStructureBundle smile = (YieldCurveWithBlackForexTermStructureBundle) black;
    final double gammaRelative = gammaRelative(optionForex, smile, directQuote);
    return CurrencyAmount.of(optionForex.getUnderlyingForex().getCurrency2(), gammaRelative * Math.abs(optionForex.getUnderlyingForex().getPaymentCurrency1().getAmount()));
  }
View Full Code Here

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

   * @return The gamma.
   */
  public CurrencyAmount gammaSpot(final ForexOptionVanilla optionForex, final YieldCurveBundle black, final boolean directQuote) {
    ArgumentChecker.notNull(black, "Curves");
    ArgumentChecker.isTrue(black instanceof YieldCurveWithBlackForexTermStructureBundle, "Yield curve bundle should contain smile data");
    final YieldCurveWithBlackForexTermStructureBundle smile = (YieldCurveWithBlackForexTermStructureBundle) black;
    final double gammaRelativeSpot = gammaRelativeSpot(optionForex, smile, directQuote);
    return CurrencyAmount.of(optionForex.getUnderlyingForex().getCurrency2(), gammaRelativeSpot * Math.abs(optionForex.getUnderlyingForex().getPaymentCurrency1().getAmount()));
  }
View Full Code Here

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

   * @return The theta. In the same currency as present value.
   */
  public CurrencyAmount thetaTheoretical(final ForexOptionVanilla optionForex, final YieldCurveBundle black) {
    ArgumentChecker.notNull(black, "Curves");
    ArgumentChecker.isTrue(black instanceof YieldCurveWithBlackForexTermStructureBundle, "Yield curve bundle should contain smile data");
    final YieldCurveWithBlackForexTermStructureBundle smile = (YieldCurveWithBlackForexTermStructureBundle) black;
    final double dfDomestic = smile.getCurve(optionForex.getUnderlyingForex().getPaymentCurrency2().getFundingCurveName()).getDiscountFactor(optionForex.getUnderlyingForex().getPaymentTime());
    final double dfForeign = smile.getCurve(optionForex.getUnderlyingForex().getPaymentCurrency1().getFundingCurveName()).getDiscountFactor(optionForex.getUnderlyingForex().getPaymentTime());
    final double spot = smile.getFxRates().getFxRate(optionForex.getCurrency1(), optionForex.getCurrency2());
    final double forward = spot * dfForeign / dfDomestic;
    final double volatility = smile.getVolatilityModel().getVolatility(optionForex.getTimeToExpiry());
    final double sign = (optionForex.isLong() ? 1.0 : -1.0);
    final double theta = BlackFormulaRepository.driftlessTheta(forward, optionForex.getStrike(), optionForex.getTimeToExpiry(), volatility) * sign
        * Math.abs(optionForex.getUnderlyingForex().getPaymentCurrency1().getAmount());
    return CurrencyAmount.of(optionForex.getUnderlyingForex().getCurrency2(), theta);
  }
View Full Code Here

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

   * @return The implied volatility.
   */
  public double impliedVolatility(final ForexOptionVanilla optionForex, final YieldCurveBundle curves) {
    ArgumentChecker.notNull(curves, "Curves");
    ArgumentChecker.isTrue(curves instanceof YieldCurveWithBlackForexTermStructureBundle, "Yield curve bundle should contain Black volatility data");
    final YieldCurveWithBlackForexTermStructureBundle black = (YieldCurveWithBlackForexTermStructureBundle) curves;
    ArgumentChecker.notNull(optionForex, "Forex option");
    ArgumentChecker.isTrue(black.checkCurrencies(optionForex.getCurrency1(), optionForex.getCurrency2()), "Option currencies not compatible with data");
    final double volatility = black.getVolatilityModel().getVolatility(optionForex.getTimeToExpiry());
    return volatility;
  }
View Full Code Here

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

      final SmileDeltaTermStructureParametersStrikeInterpolation smiles = (SmileDeltaTermStructureParametersStrikeInterpolation) volatilitySurfaceObject;
      termStructure = smiles.toTermStructureOnlyData(interpolator);
    } else {
      termStructure = (BlackForexTermStructureParameters) volatilitySurfaceObject;
    }
    final YieldCurveWithBlackForexTermStructureBundle flatData = new YieldCurveWithBlackForexTermStructureBundle(curvesWithFX, termStructure, currencyPair);
    return getResult(fxOption, flatData, target, desiredValues, inputs, spec, executionContext);
  }
View Full Code Here

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

      final SmileDeltaTermStructureParametersStrikeInterpolation smiles = (SmileDeltaTermStructureParametersStrikeInterpolation) volatilitySurfaceObject;
      final SmileDeltaTermStructureDataBundle smileBundle = new SmileDeltaTermStructureDataBundle(curvesWithFX, smiles, currencyPair);
      return smileBundle;
    }
    final BlackForexTermStructureParameters termStructure = (BlackForexTermStructureParameters) volatilitySurfaceObject;
    final YieldCurveWithBlackForexTermStructureBundle flatData = new YieldCurveWithBlackForexTermStructureBundle(curvesWithFX, termStructure, currencyPair);
    return flatData;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.