Package com.opengamma.analytics.financial

Examples of com.opengamma.analytics.financial.ExerciseDecisionType


    final double strike = option.getStrike();
    final double time = option.getTimeToExpiry();
    final double sigma = data.getVolatilitySurface().getVolatility(time, strike);
    final boolean isCall = option.isCall();
    final boolean isAmerican;
    final ExerciseDecisionType exercise = option.getExerciseType();
    if (exercise == ExerciseDecisionType.AMERICAN) {
      isAmerican = true;
    } else if (exercise == ExerciseDecisionType.EUROPEAN) {
      isAmerican = false;
    } else {
View Full Code Here


    final double strike = option.getStrike();
    final double time = option.getTimeToExpiry();
    final double sigma = data.getVolatilitySurface().getVolatility(time, strike);
    final boolean isCall = option.isCall();
    final boolean isAmerican;
    final ExerciseDecisionType exercise = option.getExerciseType();
    if (exercise == ExerciseDecisionType.AMERICAN) {
      isAmerican = true;
    } else if (exercise == ExerciseDecisionType.EUROPEAN) {
      isAmerican = false;
    } else {
View Full Code Here

      throw new OpenGammaRuntimeException("No underlying future found with identifier " + commodityOption.getUnderlyingId());
    }

    final ZonedDateTime expiry = underlyingSecurity.getExpiry().getExpiry();
    final boolean isCall = (commodityOption.getOptionType().equals(OptionType.CALL));
    final ExerciseDecisionType exerciseType = commodityOption.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());
    if (underlyingSecurity instanceof AgricultureFutureSecurity) {
      final AgricultureFutureDefinition underlyingDefinition = (AgricultureFutureDefinition) underlyingSecurity.accept(_futureSecurityConverter);
      return new AgricultureFutureOptionDefinition(expiry,
          underlyingDefinition,
          commodityOption.getStrike() * 100.0, // TODO: Remove when security stops scaling price
View Full Code Here

    final double strike = option.getStrike();
    final double time = option.getExpiry();
    final double sigma = data.getVolatilitySurface().getVolatility(time, strike);
    final boolean isCall = option.isCall();
    final boolean isAmerican;
    final ExerciseDecisionType exercise = option.getExerciseType();
    if (exercise == ExerciseDecisionType.AMERICAN) {
      isAmerican = true;
    } else if (exercise == ExerciseDecisionType.EUROPEAN) {
      isAmerican = false;
    } else {
View Full Code Here

    final boolean isCall = security.getOptionType() == OptionType.CALL;
    final double strike = security.getStrike();
    final ZonedDateTime expiryDT = security.getExpiry().getExpiry();
    final Currency ccy = security.getCurrency();
    final double unitNotional = security.getPointValue();
    final ExerciseDecisionType exerciseType = security.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());
    // TODO We need to know how long after expiry settlement occurs?
    // IndexOptions are obviously Cash Settled
    final LocalDate settlementDate = expiryDT.toLocalDate(); // FIXME Needs to come from convention
    //TODO settlement type needs to come from trade or convention
    return new EquityIndexOptionDefinition(isCall, strike, ccy, exerciseType, expiryDT, settlementDate, unitNotional, SettlementType.CASH);
View Full Code Here

    final boolean isCall = security.getOptionType() == OptionType.CALL;
    final double strike = security.getStrike();
    final ZonedDateTime expiryDT = security.getExpiry().getExpiry();
    final Currency ccy = security.getCurrency();
    final double unitNotional = security.getPointValue();
    final ExerciseDecisionType exerciseType = security.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());
    // TODO We need to know how long after expiry settlement occurs?
    // IndexOptions are obviously Cash Settled
    final LocalDate settlementDate = expiryDT.toLocalDate(); // FIXME Needs to come from convention
    //TODO settlement type needs to come from trade or convention
    return new EquityOptionDefinition(isCall, strike, ccy, exerciseType, expiryDT, settlementDate, unitNotional, SettlementType.PHYSICAL);
View Full Code Here

      EquityFutureDefinition eqFut = (EquityFutureDefinition) underlyingFuture.accept(_futureSecurityConverter);
      underlying = new IndexFutureDefinition(eqFut.getExpiryDate(), eqFut.getSettlementDate(), eqFut.getStrikePrice(), eqFut.getCurrency(), eqFut.getUnitAmount(), underlyingFuture.getUnderlyingId());
    }
  
    final double strike = security.getStrike();
    final ExerciseDecisionType exerciseType = security.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());
    final boolean isCall = security.getOptionType() == OptionType.CALL;
    final double pointValue = security.getPointValue();
    // FIXME Need the true referencePrice. 0.0 is just a stub as this converter acts upon a FinancialSecurity, not a Trade.
    return new EquityIndexFutureOptionDefinition(expiryDate, underlying, strike, exerciseType, isCall, pointValue, 0.0);
View Full Code Here

      default:
        throw new OpenGammaRuntimeException("Encountered an EquityBarrierOption with unexpected BarrierType of: " + bUpDown);
    }

    // Switch  on type
    final ExerciseDecisionType exerciseType = barrierOption.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());
    switch (bInOut) {
      case KNOCK_OUT:
        // Long a linear at strike, short a linear at barrier
        final EquityIndexOption longlinearK = new EquityIndexOption(ttm, ttm, strike, isCall, ccy, ptVal, exerciseType, SettlementType.PHYSICAL);
        final EquityIndexOption shortLinearB = new EquityIndexOption(ttm, ttm, barrier, isCall, ccy, -ptVal, exerciseType, SettlementType.PHYSICAL);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.ExerciseDecisionType

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.