Package com.opengamma.core.marketdatasnapshot

Examples of com.opengamma.core.marketdatasnapshot.YieldCurveKey


    globalValues.putValue(specB, "X", new ValueSnapshot(Double.valueOf(12), Double.valueOf(11)));

    final ManageableYieldCurveSnapshot manageableYieldCurveSnapshot = new ManageableYieldCurveSnapshot();
    manageableYieldCurveSnapshot.setValuationTime(Instant.now());
    manageableYieldCurveSnapshot.setValues(globalValues);
    yieldCurves.put(new YieldCurveKey(Currency.GBP, "Default"), manageableYieldCurveSnapshot);

    snapshot1.setYieldCurves(yieldCurves);

    final HashMap<Pair<Tenor, Tenor>, ValueSnapshot> strikes = new HashMap<Pair<Tenor, Tenor>, ValueSnapshot>();
    strikes.put(Pair.of(Tenor.DAY, Tenor.WORKING_WEEK), new ValueSnapshot(12.0, 12.0));
View Full Code Here


  @Override
  YieldCurveKey getKey(ValueSpecification spec) {
    Currency currency = Currency.parse(spec.getTargetSpecification().getUniqueId().getValue());
    String curve = getSingleProperty(spec, ValuePropertyNames.CURVE);
    return new YieldCurveKey(currency, curve);
  }
View Full Code Here

      for (final DependencyNode node : graph.getDependencyNodes()) {
        for (final ValueSpecification outputValue : node.getOutputValues()) {
          if (outputValue.getValueName().equals(ValueRequirementNames.YIELD_CURVE)) {
            addAll(ret, outputValue);
          } else if (outputValue.getValueName().equals(ValueRequirementNames.YIELD_CURVE_SPEC)) {
            final YieldCurveKey key = _yieldCurveSnapper.getKey(outputValue);
            add(ret, key, outputValue.toRequirementSpecification());
          }
        }
      }
    }
View Full Code Here

    }
    return ret;
  }

  private void addAll(final Map<YieldCurveKey, Map<String, ValueRequirement>> ret, final ValueSpecification yieldCurveSpec) {
    final YieldCurveKey key = _yieldCurveSnapper.getKey(yieldCurveSpec);

    add(ret, key, yieldCurveSpec.toRequirementSpecification());

    //We know how the properties of this relate
    final ValueRequirement interpolatedSpec = new ValueRequirement(
View Full Code Here

    String name = currentRow.get(SnapshotColumns.NAME.get());

    if (!yieldCurveBuilder.containsKey(name)) {
      ManageableYieldCurveSnapshot curve = new ManageableYieldCurveSnapshot();
      ManageableUnstructuredMarketDataSnapshot snapshot = new ManageableUnstructuredMarketDataSnapshot();
      YieldCurveKey key = new YieldCurveKey(Currency.of(currentRow.get(SnapshotColumns.YIELD_CURVE_CURRENCY.get())),
                                            currentRow.get(SnapshotColumns.NAME.get()));

      curve.setValuationTime(Instant.parse(currentRow.get(SnapshotColumns.INSTANT.get())));
      snapshot.putValue(createExternalIdBundle(currentRow),
                        currentRow.get(SnapshotColumns.VALUE_NAME.get()),
View Full Code Here

    when(snapshot.getGlobalValues()).thenReturn(generateUnstructured(testValueId, 234d));
    final UserMarketDataSnapshot userSnapshot = new UserMarketDataSnapshot(snapshot);
    userSnapshot.init();
    final YieldCurveSnapshot yieldCurveSnapshot = mock(YieldCurveSnapshot.class);
    when(yieldCurveSnapshot.getValues()).thenReturn(generateUnstructured(testValueId, 123d));
    final Map<YieldCurveKey, YieldCurveSnapshot> yieldCurveMap = ImmutableMap.of(new YieldCurveKey(Currency.USD, "testCurve"), yieldCurveSnapshot);
    when(snapshot.getYieldCurves()).thenReturn(yieldCurveMap);
    return userSnapshot;
  }
View Full Code Here

  private static final Scenario SCENARIO = new Scenario("scenario");
  private static final String CALC_CONFIG_NAME = "calcConfigName";

  private static StructureIdentifier structureId(String curveName) {
    return StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName));
  }
View Full Code Here

  public void singleCurrency() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.currencies("GBP");
    MarketDataSelector selector = curve.getSelector();
    String curveName = "curveName";
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

  public void multipleCurrencies() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.currencies("GBP", "USD");
    MarketDataSelector selector = curve.getSelector();
    String curveName = "curveName";
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName));
    StructureIdentifier structure3 = StructureIdentifier.of(new YieldCurveKey(Currency.AUD, curveName));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure3, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

    String curveName1 = "curveName1";
    String curveName2 = "curveName2";
    String curveName3 = "curveName3";
    curve.named(curveName1, curveName2).currencies("USD", "GBP");
    MarketDataSelector selector = curve.getSelector();
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName1));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName2));
    StructureIdentifier structure3 = StructureIdentifier.of(new YieldCurveKey(Currency.AUD, curveName1));
    StructureIdentifier structure4 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName3));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure3, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure4, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.core.marketdatasnapshot.YieldCurveKey

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.