Package com.opengamma.engine.value

Examples of com.opengamma.engine.value.ComputedValue


    return Collections.singleton(htsReq);
  }
 
  // Provides the current / live price
  protected Double calculateLivePrice(FunctionInputs inputs, ComputationTarget target) { 
    final ComputedValue valLivePrice = inputs.getComputedValue(MarketDataRequirementNames.MARKET_VALUE);
    if (valLivePrice == null) {
      throw new OpenGammaRuntimeException(MarketDataRequirementNames.MARKET_VALUE + " not available," + target);
    }
    return (Double) valLivePrice.getValue();
  }
View Full Code Here


      final Currency currencyNonBase = currencyPair.getCounter(); // The non-base currency
      final double delta = mca.getAmount(currencyNonBase);
      DoubleTimeSeries<?> result = getPnLSeries(startDate, now.toLocalDate(), schedule, sampling, timeSeries);
      result = result.multiply(position.getQuantity().doubleValue() * delta);
      final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.PNL_SERIES, target.toSpecification(), desiredValue.getConstraints());
      return Collections.singleton(new ComputedValue(spec, result));
    }
View Full Code Here

      return ImmutableSet.of();
    }
   
    @Override
    public Set<ComputedValue> execute(FunctionExecutionContext executionContext, FunctionInputs inputs, ComputationTarget target, Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
      return ImmutableSet.of(new ComputedValue(new ValueSpecification(ValueRequirementNames.FX_FORWARD_CURVE_DEFINITION, _targetSpec, createResultProperties()), _curveDefinition));
    }
View Full Code Here

      return ImmutableSet.of();
    }
   
    @Override
    public Set<ComputedValue> execute(FunctionExecutionContext executionContext, FunctionInputs inputs, ComputationTarget target, Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
      return ImmutableSet.of(new ComputedValue(new ValueSpecification(ValueRequirementNames.FX_FORWARD_CURVE_SPECIFICATION, _targetSpec, createResultProperties()), _curveSpecification));
    }
View Full Code Here

      Object value = executeImpl(executionContext, timeSeriesSource, targetSpec, desiredValue);
      if (value == null) {
        s_logger.error("Couldn't get time series {}", desiredValue);
        value = MissingInput.MISSING_MARKET_DATA;
      }
      return Collections.singleton(new ComputedValue(new ValueSpecification(desiredValue.getValueName(), targetSpec, desiredValue.getConstraints()), value));
    }
View Full Code Here

    final ValueProperties constraints = desiredValue.getConstraints().copy()
        .with(ValuePropertyNames.FUNCTION, getUniqueId())
        .get();
    final ValueSpecification stdVolSpec = new ValueSpecification(ValueRequirementNames.STANDARD_VOLATILITY_SURFACE_DATA,
        target.toSpecification(), constraints);
    return Collections.singleton(new ComputedValue(stdVolSpec, stdVolSurface));
  }
View Full Code Here

    final ValueProperties.Builder properties = createValueProperties();
    for (ComputedValue value : values) {
      composeValueProperties(properties, value.getSpecification());
    }
    Collections.sort(values, s_comparator);
    return Collections.singleton(new ComputedValue(ValueSpecification.of(getValueName(), ComputationTargetType.PORTFOLIO_NODE, target.getUniqueId(), properties.get()), values));
  }
View Full Code Here

    SecurityAttributeMapper mapper = DefaultSecurityAttributeMappings.create(ccyPairs);
   
    Security security = target.getPositionOrTrade().getSecurity();
    Object result = mapper.valueFor(_attribute, security);
   
    return Collections.singleton(new ComputedValue(getSpec(target), result));
  }
View Full Code Here

    final Set<ComputedValue> results = Sets.newHashSetWithExpectedSize(viewResults.size() + 1);
    final ComputationTargetSpecification targetSpec = target.toSpecification();
    for (final Map.Entry<String, HistoricalViewEvaluationResult> viewResult : viewResults.entrySet()) {
      String calcConfigName = viewResult.getKey();
      HistoricalViewEvaluationResult value = viewResult.getValue();
      results.add(new ComputedValue(getResultSpec(calcConfigName, targetSpec), value));
    }
    final HistoricalViewEvaluationMarketData viewMarketData = resultBuilder.getMarketData();
    if (viewMarketData != null) {
      results.add(new ComputedValue(getMarketDataResultSpec(targetSpec), viewMarketData));
    }
    return results;
  }
View Full Code Here

    @SuppressWarnings("unused")
    final StandardOptionDataBundle data = new StandardOptionDataBundle(discountCurve, b, null, spotPrice, now);
    // TODO Map<OptionDefinition, Double> of options that will be used to form surface
    final VolatilitySurface surface = null; // TODO
    final ValueSpecification specification = createResultSpecification(target);
    final ComputedValue result = new ComputedValue(specification, surface);
    return Collections.singleton(result);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.value.ComputedValue

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.