Package com.opengamma.financial.security.future

Examples of com.opengamma.financial.security.future.FutureSecurity.accept()


      lastMarginPrice = timeSeriesBundle.get(MarketDataRequirementNames.MARKET_VALUE, security.getExternalIdBundle()).getTimeSeries().getLatestValue();
    } catch (final NoSuchElementException e) {
      throw new OpenGammaRuntimeException("Time series for " + security.getExternalIdBundle() + " was empty");
    }
    final ZonedDateTime valuationTime = ZonedDateTime.now(executionContext.getValuationClock());
    final InstrumentDefinitionWithData<?, Double> definition = security.accept(_converter);
    final InstrumentDerivative derivative = definition.toDerivative(valuationTime, lastMarginPrice);

    // 2. Build up the market data bundle
    final SimpleFutureDataBundle market = getFutureDataBundle(security, inputs, timeSeriesBundle, desiredValues.iterator().next());
    final ValueRequirement desiredValue = desiredValues.iterator().next();
View Full Code Here


    final Double lastMarginPrice = timeSeries.getLatestValue();
    if (lastMarginPrice == null) {
      throw new OpenGammaRuntimeException("Could not find latest value in time series.");
    }

    final InstrumentDerivative derivative = security.accept(_converter).toDerivative(now, lastMarginPrice, new String[0]);

    // 2. Build up the (simple) market data bundle
    final SimpleFutureDataBundle market = new SimpleFutureDataBundle(null, getMarketPrice(security, inputs), null, null, null);

    // 3. The Calculation - what we came here to do
View Full Code Here

      throw new OpenGammaRuntimeException("Could not get market data for " + underlyingIdentifier);
    }
    final YieldAndDiscountCurve curve = (YieldAndDiscountCurve) curveObject;
    final double spot = (Double) spotObject;
    final SimpleFutureDataBundleDeprecated data = new SimpleFutureDataBundleDeprecated(curve, null, spot, 0., 0.);
    final SimpleInstrument instrument = security.accept(CONVERTER).toDerivative(now);
    final CurrencyAmount pv = instrument.accept(CALCULATOR, data);
    final ValueProperties properties = createValueProperties()
        .with(ValuePropertyNames.CURVE, _curveName)
        .with(ValuePropertyNames.CURRENCY, pv.getCurrency().getCode()).get();
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.PRESENT_VALUE, target.toSpecification(), properties);
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.