Examples of Greek


Examples of com.opengamma.analytics.financial.greeks.Greek

    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));
    }
    return riskFactors;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
    final Position position = target.getPosition();
    final Security security = position.getSecurity();
    final GreekResultCollection greekResultCollection = new GreekResultCollection();
    final Map<UnderlyingType, Double> underlyingData = new HashMap<UnderlyingType, Double>();
    Greek greek;
    Underlying order;
    List<UnderlyingType> underlyings;
    final String underlyingGreekRequirementName = AvailableValueGreeks.getGreekRequirementNameForValueGreekName(getRequirementName());
    final Double greekResult = (Double) inputs.getValue(underlyingGreekRequirementName);
    greek = AvailableGreeks.getGreekForValueRequirementName(underlyingGreekRequirementName);
    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) {
        throw new NullPointerException("Could not get value for " + underlying + " for security " + security);
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
      final Set<ValueRequirement> desiredValues) {
    final GreekResultCollection greekResultCollection = new GreekResultCollection();
    Object greekResult;   
    Greek greek;
    for (final String valueName : AvailableGreeks.getAllGreekNames()) {
      greekResult = inputs.getValue(valueName);
      if (greekResult == null) {
        s_logger.warn("Could not get value for " + valueName);
      }
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

  private final List<Pair<UnderlyingType, String>> _underlyings;

  public OptionGreekUnderlyingPriceSeriesFunction(final String resolutionKey) {
    Validate.notNull(resolutionKey, "resolution key");
    _resolutionKey = resolutionKey;
    final Greek greek = AvailableGreeks.getGreekForValueRequirementName(VALUE_REQUIREMENT_NAME);
    _underlyings = new ArrayList<Pair<UnderlyingType, String>>();
    final List<UnderlyingType> types = greek.getUnderlying().getUnderlyings();
    for (final UnderlyingType type : types) {
      _underlyings.add(Pair.of(type, ValueRequirementNames.PRICE_SERIES + "_" + type));
    }
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

      return;
    }
    assertEquals(firstResult.size(), secondResult.size());
    final Iterator<Greek> iter = firstResult.keySet().iterator();
    while (iter.hasNext()) {
      final Greek greek = iter.next();
      final Double result = firstResult.get(greek);
      assertTrue(secondResult.contains(greek));
      assertEquals(result, secondResult.get(greek), EPS);
    }
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

    final EquityOptionSecurity option = (EquityOptionSecurity) target.getSecurity();
    final StandardOptionDataBundle data = getDataBundle(executionContext.getValuationClock(), option, inputs);
    final OptionDefinition definition = getOptionDefinition(option);
    final Set<Greek> requiredGreeks = new HashSet<Greek>();
    for (final ValueRequirement dV : desiredValues) {
      final Greek desiredGreek = AvailableGreeks.getGreekForValueRequirement(dV);
      if (desiredGreek == null) {
        throw new IllegalArgumentException("Told to produce " + dV + " but couldn't be mapped to a Greek.");
      }
      requiredGreeks.add(desiredGreek);
    }
    final GreekResultCollection greeks = getModel().getGreeks(definition, data, requiredGreeks);
    final Set<ComputedValue> results = new HashSet<ComputedValue>();
    for (final ValueRequirement dV : desiredValues) {
      final Greek greek = AvailableGreeks.getGreekForValueRequirement(dV);
      assert greek != null : "Should have thrown IllegalArgumentException above.";
      final Double greekResult = greeks.get(greek);
      final ComputedValue resultValue = new ComputedValue(getResultSpecification(dV.getValueName(), target, option, dV.getConstraint(ValuePropertyNames.CURVE)), greekResult);
      results.add(resultValue);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.greeks.Greek

    final double strike = getStrike(fxOption, currencyPair);
    final PDEResultCollection gridGreeks = (PDEResultCollection) gridGreeksObject;
    final ComputationTargetSpecification spec = target.toSpecification();
    final Set<ComputedValue> result = new HashSet<ComputedValue>();
    for (final ValueRequirement value : desiredValues) {
      final Greek greek = s_greekNamesToGreeks.get(value.getValueName());
      final String strikeInterpolatorName = value.getConstraint(PROPERTY_RESULT_STRIKE_INTERPOLATOR);
      final Double point = gridGreeks.getPointGreek(greek, strike, Interpolator1DFactory.getInterpolator(strikeInterpolatorName));
      if (point == null) {
        throw new OpenGammaRuntimeException("Grid greeks for " + greek + " were null");
      }
View Full Code Here

Examples of org.languagetool.language.Greek

*/
public class GreekRuleDisambiguator extends AbstractRuleDisambiguator {

    @Override
    protected Language getLanguage() {
        return new Greek();
    }
View Full Code Here

Examples of org.languagetool.language.Greek

import org.languagetool.language.Greek;

public class GreekConcurrencyTest extends AbstractLanguageConcurrencyTest {
  @Override
  protected Language createLanguage() {
    return new Greek();
  }
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.