Examples of FutureOptionSecurityDefinition


Examples of com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb.FutureOptionSecurityDefinition

  }

  //-------------------------------------------------------------------------
  @Override
  protected ManageableSecurity createSecurity() {
    FutureOptionSecurityDefinition defn = getSecurityDefinition();
    ExternalId underlyingId = defn.getUnderlyingId().toExternalId();
    Expiry expiry = new Expiry(defn.getFutureExpiry().atDay(1).atStartOfDay(ZoneOffset.UTC), ExpiryAccuracy.MONTH_YEAR);
    String exchange = defn.getExchange();
    Currency currency = defn.getCurrency();
    int pointValue = defn.getPointValue();
    boolean isMargined = defn.isIsMargined();
    double strike = defn.getStrike().doubleValue();
    OptionType optionType = defn.getOptionType();
    ExerciseType exerciseType = defn.getExerciseType().convert();

    switch (defn.getListedFutureOptionType()) {
      case EQUITY_INDEX_FUTURE_OPTION:
        return new EquityIndexFutureOptionSecurity(exchange, expiry, exerciseType, underlyingId, pointValue,
                                                   isMargined, currency, strike, optionType);
      case EQUITY_DIVIDEND_FUTURE_OPTION:
        return new EquityIndexDividendFutureOptionSecurity(exchange,  expiry, exerciseType, underlyingId, pointValue,
                                                           isMargined, currency, strike, optionType);
      default:
        // The xml validation should prevent this from happening
        throw new PortfolioParsingException("Unrecognised listed option type: " + defn.getListedFutureOptionType());
    }
  }
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.