Examples of VarianceSwapDefinition


Examples of com.opengamma.analytics.financial.instrument.varianceswap.VarianceSwapDefinition

  private final DoubleTimeSeries<LocalDate> emptyTimeSeries = ImmutableLocalDateDoubleTimeSeries.EMPTY_SERIES;

  @Test
  public void forwardStarting() {
    // Construct a forward starting swap, Definition
    final VarianceSwapDefinition varSwapDefn = new VarianceSwapDefinition(tPlus2, plus5y, plus5y, obsFreq, ccy, WEEKENDCAL, obsPerYear, volStrike, volNotional);
    // Construct a forward starting swap, Derivative
    varSwapDefn.toDerivative(now, emptyTimeSeries);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.varianceswap.VarianceSwapDefinition

  @Test(expectedExceptions = IllegalArgumentException.class)
  // FIXME Failing on purpose so that we don't forget to extend
  public void weeklyObservations() {
    final PeriodFrequency freqWeek = PeriodFrequency.WEEKLY;
    new VarianceSwapDefinition(tPlus2, plus5y, plus5y, freqWeek, ccy, WEEKENDCAL, obsPerYear, volStrike, volNotional);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.varianceswap.VarianceSwapDefinition

    final EquityVarianceSwapSecurity security = (EquityVarianceSwapSecurity) target.getSecurity();

    final Clock snapshotClock = executionContext.getValuationClock();
    final ZonedDateTime now = ZonedDateTime.now(snapshotClock).minusYears(2); //TODO remove me - just for testing

    final VarianceSwapDefinition defn = security.accept(_converter);
    final HistoricalTimeSeries timeSeries = (HistoricalTimeSeries) inputs.getValue(ValueRequirementNames.HISTORICAL_TIME_SERIES);
    final VarianceSwap deriv = defn.toDerivative(now, timeSeries.getTimeSeries());

    // 2. Build up the market data bundle
    final Object volSurfaceObject = inputs.getValue(getVolatilitySurfaceRequirement(security, surfaceName));
    if (volSurfaceObject == null) {
      throw new OpenGammaRuntimeException("Could not get Volatility Surface");
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.