Examples of SwaptionTrade


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

  }

  //-------------------------------------------------------------------------
  @Override
  public ManageableSecurity[] extractSecurities() {
    SwaptionTrade trade = getTrade();
    SwapTrade swapTrade = trade.getUnderlyingSwapTrade();
    ManageableSecurity underlying = swapTrade.getSecurityExtractor().extractSecurities()[0];

    ExternalId underlyingId = underlying.getExternalIdBundle().getExternalId(ExternalScheme.of("XML_LOADER"));

    List<FixedLeg> fixedLegs = Lists.newArrayList(swapTrade.getFixedLegs());

    //note - these fields are resolved on a best effort basis
    //since they aren't actually used by the analytics.
    //see PLAT-1924
    Currency currency = null;
    boolean isPayer = false;

    if (!fixedLegs.isEmpty()) {
      currency = fixedLegs.get(0).getCurrency();
      isPayer = fixedLegs.get(0).getDirection() == Direction.PAY;
    }

    Expiry expiry = new Expiry(convertLocalDate(trade.getExpirationDate()));

    ManageableSecurity security = new SwaptionSecurity(
        isPayer, underlyingId, trade.getBuySell() == BuySell.BUY,
        expiry, trade.getSettlementType() == SettlementType.CASH_SETTLED,
        currency,
        null, trade.getExerciseType().convert(),
        convertLocalDate(trade.getCashSettlementPaymentDate()));

    return securityArray(addIdentifier(security), underlying);
  }
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.