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

Examples of com.opengamma.analytics.financial.model.option.definition.StandardOptionWithSpotTimeSeriesDataBundle.withVolatilitySurface()


    assertEquals(MODEL.getPricingFunction(option).evaluate(data), 8.4878, EPS);
    ts = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2010, 6, 1), DateUtils.getUTCDate(2010, 11, 1)}, new double[] {SPOT, 120});
    data = data.withSpotTimeSeries(ts);
    assertEquals(MODEL.getPricingFunction(option).evaluate(data), 4.5235, EPS);
    option = new ExtremeSpreadOptionDefinition(EXPIRY, true, new Expiry(DateUtils.getDateOffsetWithYearFraction(DATE, 0.75)), true);
    data = data.withVolatilitySurface(new VolatilitySurface(ConstantDoublesSurface.from(0.3)));
    ts = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2010, 6, 1), DateUtils.getUTCDate(2010, 11, 1)}, new double[] {SPOT, 100});
    data = data.withSpotTimeSeries(ts);
    assertEquals(MODEL.getPricingFunction(option).evaluate(data), 13.3404, EPS);
    ts = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2010, 6, 1), DateUtils.getUTCDate(2010, 11, 1)}, new double[] {SPOT, 90});
    data = data.withSpotTimeSeries(ts);
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.