Package com.opengamma.financial.security.option

Examples of com.opengamma.financial.security.option.AmericanExerciseType


  }
 
  protected ExerciseType getExerciseType(String bbgExerciseType) {
    final ExerciseType result;
    if (bbgExerciseType.equalsIgnoreCase("American")) {
      result = new AmericanExerciseType();
    } else if (bbgExerciseType.equalsIgnoreCase("European")) {
      result = new EuropeanExerciseType();
    } else {
      // an option exercise type we don't support
      _logger.warn("option exercise type {} not currently supported", bbgExerciseType);
View Full Code Here


  public void testDuplicateSecurities() {
    final Impl impl = new Impl();
    ZonedDateTime now = ZonedDateTime.now();
    final EquityOptionSecurity security1 =
        new EquityOptionSecurity(OptionType.CALL, 1.0, Currency.USD, ExternalId.of("S", "V"),
                                 new AmericanExerciseType(), new Expiry(now), 1.0, "EXCH");
    final EquityOptionSecurity security2 =
        new EquityOptionSecurity(OptionType.CALL, 1.0, Currency.USD, ExternalId.of("S", "V"),
                                 new AmericanExerciseType(), new Expiry(now), 1.0, "EXCH");
    final ExternalIdBundle identifiers1 = impl.storeSecurity(security1);
    assertSame(impl._security, security1);
    assertEquals(security1.getExternalIdBundle(), identifiers1);
    impl._security = null;
    final ExternalIdBundle identifiers2 = impl.storeSecurity(security2);
View Full Code Here

    assertSame(identifiers2, identifiers1);
  }

  public void testDifferentSecurities() {
    final Impl impl = new Impl();
    final EquityOptionSecurity security1 = new EquityOptionSecurity(OptionType.CALL, 1.0, Currency.USD, ExternalId.of("S", "V1"), new AmericanExerciseType(), new Expiry(ZonedDateTime.now()), 1.0,
        "EXCH");
    final EquityOptionSecurity security2 = new EquityOptionSecurity(OptionType.CALL, 1.0, Currency.USD, ExternalId.of("S", "V2"), new AmericanExerciseType(), new Expiry(ZonedDateTime.now()), 1.0,
        "EXCH");
    final ExternalIdBundle identifiers1 = impl.storeSecurity(security1);
    assertSame(impl._security, security1);
    assertEquals(security1.getExternalIdBundle(), identifiers1);
    impl._security = null;
View Full Code Here

    security.setUniqueId(createUniqueId("Security"));
    return security;
  }

  protected Security createEquityOptionSecurity(final String name, final OptionType type, final double strike, final ExternalId underlying) {
    final EquityOptionSecurity security = new EquityOptionSecurity(type, strike, Currency.USD, underlying, new AmericanExerciseType(),
        new Expiry(zdt(2010, 10, 10, 12, 0, 0, 0, ZoneOffset.UTC)), 0d, "EXCH");
    security.setExternalIdBundle(createExternalIdBundle());
    security.setName(name);
    security.setUniqueId(createUniqueId("Security"));
    return security;
View Full Code Here

    double strike = 1000.0;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2013, 3, 15));
    ExternalId underlyingUniqueID = ExternalSchemes.bloombergBuidSecurityId("IX14248603-0");

    final EquityIndexFutureOptionSecurity security = new EquityIndexFutureOptionSecurity(
        "CME", expiry, new AmericanExerciseType(), underlyingUniqueID, 50.0, true, USD, strike, optionType);

    Set<ExternalId> identifiers = ImmutableSet.of(
      ExternalSchemes.bloombergBuidSecurityId("IX15354067-0-FD00"),
      ExternalSchemes.bloombergTickerSecurityId("ESH3C 1000 Index"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

  public static EquityOptionSecurity makeAPVLEquityOptionSecurity() {
    OptionType optionType = OptionType.CALL;
    double strike = 190.0;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2010, 01, 16));
    ExternalId underlyingIdentifier = ExternalSchemes.bloombergTickerSecurityId(AAPL_EQUITY_TICKER);
    final EquityOptionSecurity security = new EquityOptionSecurity(optionType, strike, USD, underlyingIdentifier, new AmericanExerciseType(), expiry, 100, "US");

    Set<ExternalId> identifiers = new HashSet<>();
    identifiers.add(ExternalSchemes.bloombergTickerSecurityId(APV_EQUITY_OPTION_TICKER));
    identifiers.add(ExternalSchemes.bloombergBuidSecurityId("EO1016952010010397C00001"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

    double strike = 0.995;
    double pointValue = 2500;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2012, 12, 17));
    ExternalId underlyingID = ExternalSchemes.bloombergTickerSecurityId("EDZ2 Comdty");
    final String exchange = "CME";
    final IRFutureOptionSecurity security = new IRFutureOptionSecurity(exchange, expiry, new AmericanExerciseType(), underlyingID, pointValue, false, USD, strike, optionType);

    Set<ExternalId> identifiers = new HashSet<>();
    identifiers.add(ExternalSchemes.bloombergBuidSecurityId("IX11675985-0-8C70"));
    identifiers.add(ExternalSchemes.bloombergTickerSecurityId("EDZ2C 99.500 Comdty"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

    double strike = 0.91;
    double pointValue = 1250.0;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2011, 9, 21));
    ExternalId underlyingID = ExternalSchemes.bloombergTickerSecurityId("L U11 Comdty");
    final String exchange = "LIF";
    final IRFutureOptionSecurity security = new IRFutureOptionSecurity(exchange, expiry, new AmericanExerciseType(), underlyingID, pointValue, true, GBP, strike, optionType);

    Set<ExternalId> identifiers = new HashSet<>();
    identifiers.add(ExternalSchemes.bloombergBuidSecurityId("IX9494155-0-8B60"));
    identifiers.add(ExternalSchemes.bloombergTickerSecurityId("L U1C 91.000 Comdty"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

    double pointValue = 2500;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2011, 9, 19));
    ExternalId underlyingID = ExternalSchemes.bloombergTickerSecurityId("FPU11 Comdty");
    final String exchange = "EUX";
    final IRFutureOptionSecurity security = new IRFutureOptionSecurity(
        exchange, expiry, new AmericanExerciseType(), underlyingID, pointValue, true, EUR, strike, optionType);

    Set<ExternalId> identifiers = new HashSet<>();
    identifiers.add(ExternalSchemes.bloombergBuidSecurityId("IX10090132-0-8B9C"));
    identifiers.add(ExternalSchemes.bloombergTickerSecurityId("FPU1C 92.875 Comdty"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

    double pointValue = 1000;
    Expiry expiry = new Expiry(DateUtils.getUTCDate(2013, 2, 19));
    ExternalId underlyingID = ExternalSchemes.bloombergTickerSecurityId("CHH3 Comdty");
    final String exchange = "NYM";
    final CommodityFutureOptionSecurity security = new CommodityFutureOptionSecurity(
        exchange, exchange, expiry, new AmericanExerciseType(), underlyingID, pointValue, USD, strike, optionType);

    Set<ExternalId> identifiers = ImmutableSet.of(
        ExternalSchemes.bloombergBuidSecurityId("IX12576261-0-8308"),
        ExternalSchemes.bloombergTickerSecurityId("CHH3C 24.25 Comdty"));
    security.setExternalIdBundle(ExternalIdBundle.of(identifiers));
View Full Code Here

TOP

Related Classes of com.opengamma.financial.security.option.AmericanExerciseType

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.