Package com.opengamma.analytics.financial.equity.variance.pricing

Examples of com.opengamma.analytics.financial.equity.variance.pricing.EquityVarianceSwapPricer


      final SmileSurfaceDataBundle v4 = getMarketVols(SPOT, EXPIRIES, STRIKES, DISCOUNT_CURVE, NULL_DIVIDENDS, PURE_VOL_SURFACE);
      final SmileSurfaceDataBundle v5 = getMarketVols(SPOT, EXPIRIES, STRIKES, DISCOUNT_CURVE, DIVIDENDS, PURE_VOL_SURFACE);
      final SmileSurfaceDataBundle v6 = v5;

      //now assume that the implied volatilities remain fixed as the spot moves
      final EquityVarianceSwapPricer pricer = EquityVarianceSwapPricer.builder().create();
      final double d1 = pricer.gammaWithStickyLocalVol(EVS, SPOT, DISCOUNT_CURVE, NULL_DIVIDENDS, v1);
      final double d2 = pricer.gammaWithStickyLocalVol(EVS_COR_FRO_DIVS, SPOT, DISCOUNT_CURVE, DIVIDENDS, v2);
      final double d3 = pricer.gammaWithStickyLocalVol(EVS, SPOT, DISCOUNT_CURVE, DIVIDENDS, v3);
      final double d4 = pricer.gammaWithStickyLocalVol(EVS, SPOT, DISCOUNT_CURVE, NULL_DIVIDENDS, v4);
      final double d5 = pricer.gammaWithStickyLocalVol(EVS_COR_FRO_DIVS, SPOT, DISCOUNT_CURVE, DIVIDENDS, v5);
      final double d6 = pricer.gammaWithStickyLocalVol(EVS, SPOT, DISCOUNT_CURVE, DIVIDENDS, v6);

      System.out.println("Flat, no divs:\t" + d1);
      System.out.println("Flat, divs corr:\t" + d2);
      System.out.println("Flat, divs not corr:\t" + d3);
      System.out.println("Non-flat, no divs:\t" + d4);
View Full Code Here


    final YieldAndDiscountCurve yieldCurve = (YieldAndDiscountCurve) yieldCurveObject;
    final AffineDividends dividends = (AffineDividends) dividendsObject;
    final SmileSurfaceDataBundle volatilities = getData(inputs);
    final DoubleTimeSeries<LocalDate> underlyingTS = ((HistoricalTimeSeries) tsObject).getTimeSeries();
    final EquityVarianceSwap swap = definition.toDerivative(now, underlyingTS);
    final EquityVarianceSwapPricer pricer = EquityVarianceSwapPricer.builder().create(); //TODO don't just use defaults
    final double pv = pricer.priceFromImpliedVolsBackwardPDE(swap, spot, yieldCurve, dividends, volatilities);
    final ValueProperties properties = desiredValue.getConstraints().copy()
        .withoutAny(ValuePropertyNames.FUNCTION).with(ValuePropertyNames.FUNCTION, getUniqueId()).get();
    final ValueSpecification spec = new ValueSpecification(getValueRequirementName(), target.toSpecification(), properties);
    return Collections.singleton(new ComputedValue(spec, pv));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.equity.variance.pricing.EquityVarianceSwapPricer

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.