Examples of OptionSecurityDefinition


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

  }

  //-------------------------------------------------------------------------
  @Override
  protected ManageableSecurity createSecurity() {
    OptionSecurityDefinition defn = getSecurityDefinition();
    switch (defn.getListedOptionType()) {
      case EQUITY_DIVIDEND_OPTION:
        throw new PortfolioParsingException("EquityIndexDividendOption is not yet supported");
      case EQUITY_INDEX_OPTION:
        ExternalId underlyingId = defn.getUnderlyingId().toExternalId();
        ExerciseType exerciseType = defn.getExerciseType().convert();

        // We are only give month/year (e.g. MAR13) so arbitrarily use the first day of
        // the month but set the accuracy to reflect that
        Expiry expiry = new Expiry(defn.getOptionExpiry().atDay(1).atStartOfDay(ZoneOffset.UTC),
                                   ExpiryAccuracy.MONTH_YEAR);

        return new EquityIndexOptionSecurity(defn.getOptionType(),
                                             defn.getStrike().doubleValue(),
                                             defn.getCurrency(),
                                             underlyingId,
                                             exerciseType,
                                             expiry,
                                             defn.getPointValue(),
                                             defn.getExchange());
      default:
        // Should be prevented by XML parsing
        throw new PortfolioParsingException("Unrecognised listed option type: " + defn.getListedOptionType());
    }
  }
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.