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

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


  @Test
  public void test() {
    assertEquals(BCG.getPricingFunction(OPTION).evaluate(DATA), 19.9147, 1e-4);
    final EuropeanVanillaOptionDefinition underlying = new EuropeanVanillaOptionDefinition(SPOT - 100, UNDERLYING_EXPIRY, true);
    final EuropeanOptionOnEuropeanVanillaOptionDefinition option = new EuropeanOptionOnEuropeanVanillaOptionDefinition(20, EXPIRY, true, underlying);
    assertEquals(BCG.getPricingFunction(option).evaluate(DATA) / MODEL.getPricingFunction(option).evaluate(DATA), 1, 1e-2);
  }
View Full Code Here


  @Test
  public void test() {
    assertEquals(MODEL.getPricingFunction(OPTION).evaluate(DATA), 21.196, 1e-3);
    final EuropeanVanillaOptionDefinition call = new EuropeanVanillaOptionDefinition(UNDERLYING_STRIKE, UNDERLYING_EXPIRY, true);
    final EuropeanVanillaOptionDefinition put = new EuropeanVanillaOptionDefinition(UNDERLYING_STRIKE, EXPIRY, false);
    final EuropeanOptionOnEuropeanVanillaOptionDefinition callOnCall = new EuropeanOptionOnEuropeanVanillaOptionDefinition(STRIKE, EXPIRY, true, call);
    final EuropeanOptionOnEuropeanVanillaOptionDefinition putOnCall = new EuropeanOptionOnEuropeanVanillaOptionDefinition(STRIKE, EXPIRY, false, call);
    assertEquals(MODEL.getPricingFunction(callOnCall).evaluate(DATA) - MODEL.getPricingFunction(putOnCall).evaluate(DATA),
        BSM.getPricingFunction(call).evaluate(DATA) - STRIKE * Math.exp(-0.08 * 0.25), 1e-3);
    final EuropeanOptionOnEuropeanVanillaOptionDefinition callOnPut = new EuropeanOptionOnEuropeanVanillaOptionDefinition(STRIKE, EXPIRY, true, put);
    final EuropeanOptionOnEuropeanVanillaOptionDefinition putOnPut = new EuropeanOptionOnEuropeanVanillaOptionDefinition(STRIKE, EXPIRY, false, put);
    assertEquals(MODEL.getPricingFunction(callOnPut).evaluate(DATA) - MODEL.getPricingFunction(putOnPut).evaluate(DATA), BSM.getPricingFunction(put).evaluate(DATA) - STRIKE * Math.exp(-0.08 * 0.25),
        1e-3);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.option.definition.EuropeanOptionOnEuropeanVanillaOptionDefinition

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.