Examples of InterpolatedYieldCurveSpecificationWithSecurities


Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final String resolutionKey = parseString(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.RESOLUTION_KEY_PROPERTY));
    final LocalDate startDate = DateConstraint.evaluate(executionContext, desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY));
    final boolean includeStart = HistoricalTimeSeriesFunctionUtils.parseBoolean(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY));
    final LocalDate endDate = DateConstraint.evaluate(executionContext, desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.END_DATE_PROPERTY));
    final boolean includeEnd = HistoricalTimeSeriesFunctionUtils.parseBoolean(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.INCLUDE_END_PROPERTY));
    final InterpolatedYieldCurveSpecificationWithSecurities yieldCurve = (InterpolatedYieldCurveSpecificationWithSecurities) inputs.getAllValues().iterator().next().getValue();
    final HistoricalTimeSeriesBundle bundle = new HistoricalTimeSeriesBundle();
    for (final FixedIncomeStripWithSecurity strip : yieldCurve.getStrips()) {
      final Security security = strip.getSecurity();
      if (security instanceof FinancialSecurity) {
        final FinancialSecurity financialSecurity = (FinancialSecurity) security;
        final Set<ExternalIdBundle> idBundles = financialSecurity.accept(provider);
        for (final ExternalIdBundle id : idBundles) {
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final String resolutionKey = parseString(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.RESOLUTION_KEY_PROPERTY));
    final LocalDate startDate = DateConstraint.evaluate(executionContext, desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY));
    final boolean includeStart = HistoricalTimeSeriesFunctionUtils.parseBoolean(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY));
    final LocalDate endDate = DateConstraint.evaluate(executionContext, desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.END_DATE_PROPERTY));
    final boolean includeEnd = HistoricalTimeSeriesFunctionUtils.parseBoolean(desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.INCLUDE_END_PROPERTY));
    final InterpolatedYieldCurveSpecificationWithSecurities yieldCurve = (InterpolatedYieldCurveSpecificationWithSecurities) inputs.getAllValues().iterator().next().getValue();
    final HistoricalTimeSeriesBundle bundle = new HistoricalTimeSeriesBundle();
    for (final FixedIncomeStripWithSecurity strip : yieldCurve.getStrips()) {
      final ExternalIdBundle id = ExternalIdBundle.of(strip.getSecurityIdentifier());
      final HistoricalTimeSeries timeSeries = timeSeriesSource.getHistoricalTimeSeries(dataField, id, resolutionKey, startDate, includeStart, endDate, includeEnd);
      if (timeSeries != null) {
        if (timeSeries.getTimeSeries().isEmpty()) {
          s_logger.warn("Time series for {} is empty", id);
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final LocalDate[] schedule = HOLIDAY_REMOVER.getStrippedSchedule(scheduleCalculator.getSchedule(tsStart, returnSeriesEnd, true, false), WEEKEND_CALENDAR);

    final ComputedValue bundleValue = inputs.getComputedValue(ValueRequirementNames.YIELD_CURVE_HISTORICAL_TIME_SERIES);
    final HistoricalTimeSeriesBundle bundle = (HistoricalTimeSeriesBundle) bundleValue.getValue();
    final boolean includeStart = HistoricalTimeSeriesFunctionUtils.parseBoolean(bundleValue.getSpecification().getProperty(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY));
    final InterpolatedYieldCurveSpecificationWithSecurities curveSpec = (InterpolatedYieldCurveSpecificationWithSecurities) inputs.getValue(ValueRequirementNames.YIELD_CURVE_SPEC);
    final FXForwardCurveDefinition fxForwardCurveDefinition = (FXForwardCurveDefinition) inputs.getValue(ValueRequirementNames.FX_FORWARD_CURVE_DEFINITION);

    Tenor[] tenors;
    boolean[] sensitivityToRate;
    if (curveSpec != null) {
      final Set<FixedIncomeStripWithSecurity> strips = curveSpec.getStrips();
      final int n = strips.size();
      tenors = new Tenor[n];
      sensitivityToRate = new boolean[n];
      int i = 0;
      for (final FixedIncomeStripWithSecurity strip : strips) {
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final Object specObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE_SPEC);
    if (specObject == null) {
      throw new OpenGammaRuntimeException("Could not get yield curve specification for " + curveName + " and target " + target.getName());
    }
    final SnapshotDataBundle marketData = (SnapshotDataBundle) dataObject;
    final InterpolatedYieldCurveSpecificationWithSecurities yieldCurveSpec = (InterpolatedYieldCurveSpecificationWithSecurities) specObject;

    final int nNodes = yieldCurveSpec.getStrips().size();
    final double[] marketDataForCurve = new double[nNodes];
    final ISDAInstrumentTypes[] instruments = new ISDAInstrumentTypes[nNodes];
    final Period[] tenors = new Period[nNodes];
    int k = 0;

    DayCount cashDCC = null;
    DayCount fixDCC = null;
    BusinessDayConvention floatBadDayConv = null;
    Period paymentTenor = null;

    for (final FixedIncomeStripWithSecurity strip : yieldCurveSpec.getStrips()) {
      final String securityType = strip.getSecurity().getSecurityType();
      if (!(securityType.equals(CashSecurity.SECURITY_TYPE) || securityType.equals(SwapSecurity.SECURITY_TYPE) || securityType.equals(specObject))) {
        throw new OpenGammaRuntimeException("ISDA curves should only use Libor and swap rates");
      }
      final Double marketValue = marketData.getDataPoint(strip.getSecurityIdentifier());
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final ValueRequirement curveSpecRequirement = getCurveSpecRequirement(currency, curveName);
    final Object curveSpecObject = inputs.getValue(curveSpecRequirement);
    if (curveSpecObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + curveSpecRequirement);
    }
    final InterpolatedYieldCurveSpecificationWithSecurities curveSpec = (InterpolatedYieldCurveSpecificationWithSecurities) curveSpecObject;
    final YieldCurveWithBlackCubeBundle data = new YieldCurveWithBlackCubeBundle(volatilitySurface.getSurface(), curves);
    final YieldCurveWithBlackCubeBundle fixedData = fixedCurves == null ? null : new YieldCurveWithBlackCubeBundle(volatilitySurface.getSurface(), fixedCurves);
    final Object jacobianObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE_JACOBIAN);
    if (jacobianObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + ValueRequirementNames.YIELD_CURVE_JACOBIAN);
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.InterpolatedYieldCurveSpecificationWithSecurities

    final YieldCurveWithBlackCubeBundle fixedData = null; //TODO deal with fixed curves
    final Object curveSpecObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE_SPEC);
    if (curveSpecObject == null) {
      throw new OpenGammaRuntimeException("Could not get curve specification for " + curveName);
    }
    final InterpolatedYieldCurveSpecificationWithSecurities curveSpec = (InterpolatedYieldCurveSpecificationWithSecurities) curveSpecObject;
    final Object jacobianObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE_JACOBIAN);
    if (jacobianObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + ValueRequirementNames.YIELD_CURVE_JACOBIAN);
    }
    final double[][] array = FunctionUtils.decodeJacobian(jacobianObject);
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.