Examples of PoweredOptionDefinition


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

  private static final double BIG_EPS = 1e-4;

  @Test
  public void testNonIntegerPower() {
    try {
      POWERED_MODEL.getGreeks(new PoweredOptionDefinition(100, EXPIRY, 1.3, true), getBundle(0.), REQUIRED_GREEKS);
      Assert.fail();
    } catch (final OptionPricingException e) {
      // Expected
    }
  }
View Full Code Here

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

    }
  }

  @Test
  public void testPowerOfOne() {
    PoweredOptionDefinition poweredDefinition = getPoweredDefinition(1, true);
    EuropeanVanillaOptionDefinition vanillaDefinition = getVanillaOption(true);
    assertPriceEquals(poweredDefinition, vanillaDefinition, 0.1);
    assertPriceEquals(poweredDefinition, vanillaDefinition, 0.2);
    assertPriceEquals(poweredDefinition, vanillaDefinition, 0.3);
    poweredDefinition = getPoweredDefinition(1, false);
View Full Code Here

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

    assertPriceEquals(poweredDefinition, vanillaDefinition, 0.3);
  }

  @Test
  public void test() {
    PoweredOptionDefinition definition = getPoweredDefinition(2, true);
    assertPriceEquals(definition, 0.1, 53.4487);
    assertPriceEquals(definition, 0.2, 160.2944);
    assertPriceEquals(definition, 0.3, 339.3713);
    definition = getPoweredDefinition(3, true);
    assertPriceEquals(definition, 0.1, 758.8427);
View Full Code Here

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

  private StandardOptionDataBundle getBundle(final double sigma) {
    return new StandardOptionDataBundle(CURVE, B, new VolatilitySurface(ConstantDoublesSurface.from(sigma)), SPOT, DATE);
  }

  private PoweredOptionDefinition getPoweredDefinition(final double power, final boolean isCall) {
    return new PoweredOptionDefinition(STRIKE, EXPIRY, power, isCall);
  }
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.