Package com.opengamma.core.historicaltimeseries

Examples of com.opengamma.core.historicaltimeseries.HistoricalTimeSeriesAdjustment


    final Object value;
    if (checkMissing(executionContext, latestDataPoint, ageLimit)) {
      value = MissingInput.MISSING_MARKET_DATA;
    } else {
      final String adjusterString = desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY);
      final HistoricalTimeSeriesAdjustment htsa = HistoricalTimeSeriesAdjustment.parse(adjusterString);
      value = htsa.adjust(latestDataPoint.getSecond());
    }
    return Collections.singleton(new ComputedValue(new ValueSpecification(desiredValue.getValueName(), target.toSpecification(), desiredValue.getConstraints()), value));
  }
View Full Code Here


    resolver.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo(), adjuster));
    final HistoricalTimeSeriesResolutionResult result = client.resolve(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")), null, null, null, "PX_LAST", null);
    assertNotNull(result);
    adjuster.setIdentifierBundle(ExternalIdBundle.of(ExternalId.of("Test1", "Foo")));
    adjuster.setResult(HistoricalTimeSeriesAdjustment.NoOp.INSTANCE);
    HistoricalTimeSeriesAdjustment adjustment = result.getAdjuster().getAdjustment(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")));
    assertEquals(adjustment.toString(), "100.0 /");
    adjustment = result.getAdjuster().getAdjustment(ExternalIdBundle.of(ExternalId.of("Test1", "Foo")));
    assertEquals(adjustment.toString(), "");
  }
View Full Code Here

          return null;
        } else {
          final ValueProperties.Builder properties = ValueProperties.with(ValuePropertyNames.FUNCTION, getSyntheticFunctionName());
          if (resolved.getAdjuster() != null) {
            final ExternalIdBundle resolvedIdentifiers = resolved.getHistoricalTimeSeriesInfo().getExternalIdBundle().toBundle(date);
            final HistoricalTimeSeriesAdjustment adjustment = resolved.getAdjuster().getAdjustment(resolvedIdentifiers);
            properties.with(NORMALIZATION_PROPERTY, adjustment.toString());
          }
          return new ValueSpecification(desiredValue.getValueName(), ComputationTargetSpecification.of(resolved.getHistoricalTimeSeriesInfo().getUniqueId()), properties.get());
        }
      }
View Full Code Here

TOP

Related Classes of com.opengamma.core.historicaltimeseries.HistoricalTimeSeriesAdjustment

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.