Package com.opengamma.analytics.financial.trade

Examples of com.opengamma.analytics.financial.trade.OptionTradeData


  public Map<ValueGreek, Double> evaluate(final GreekDataBundle data) {
    ArgumentChecker.notNull(data, "data");
    final GreekResultCollection greeks = data.getGreekResults();
    final Map<ValueGreek, Double> riskFactors = new HashMap<>();
    final Map<UnderlyingType, Double> underlyingData = data.getUnderlyingData();
    final OptionTradeData tradeData = data.getOptionTradeData();
    for (final Pair<Greek, Double> entry : greeks) {
      final Greek key = entry.getFirst();
      final Double value = entry.getSecond();
      riskFactors.put(new ValueGreek(key), getValueGreek(key, value, underlyingData, tradeData));
    }
View Full Code Here


    greekResultCollection.put(greek, greekResult);
    double pointValue = 1.0;
    if (security instanceof EquityOptionSecurity) {
      pointValue = ((EquityOptionSecurity) security).getPointValue();
    }
    final OptionTradeData tradeData = new OptionTradeData(position.getQuantity().doubleValue(), pointValue);
    order = greek.getUnderlying();
    underlyings = order.getUnderlyings();
    for (final UnderlyingType underlying : underlyings) {
      final Double underlyingValue = (Double) inputs.getValue(UnderlyingTypeToValueRequirementMapper.getValueRequirement(underlying, security));
      if (underlyingValue == null) {
View Full Code Here

        throw new IllegalArgumentException("Can only handle Double greeks.");
      }
      greek = AvailableGreeks.getGreekForValueRequirementName(valueName);
      greekResultCollection.put(greek, (Double) greekResult);
    }
    final GreekDataBundle dataBundle = new GreekDataBundle(greekResultCollection, null, new OptionTradeData(target.getPosition().getQuantity().doubleValue(), 25));
    final Map<PositionGreek, Double> positionGreeks = _converter.evaluate(dataBundle);
    final Set<ComputedValue> results = new HashSet<ComputedValue>();
    PositionGreek positionGreek;
    Double positionGreekResult;
    ValueSpecification resultSpecification;
View Full Code Here

    greeks.put(Greek.DELTA, DELTA_VALUE + 1);
    other = new GreekDataBundle(greeks, UNDERLYING_DATA, OPTION_TRADE_DATA);
    assertFalse(DATA.equals(other));
    other = new GreekDataBundle(GREEK_RESULTS, underlyingData, OPTION_TRADE_DATA);
    assertFalse(DATA.equals(other));
    other = new GreekDataBundle(GREEK_RESULTS, UNDERLYING_DATA, new OptionTradeData(200, 10));
    assertFalse(DATA.equals(other));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.trade.OptionTradeData

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.