Package com.opengamma.financial.security.future

Examples of com.opengamma.financial.security.future.MetalFutureSecurity


    assertEquals(ExternalId.of(ExposureFunction.SECURITY_IDENTIFIER, "FUTURE_Y"), ids.get(0));
  }

  @Test
  public void testMetalFutureSecurity() {
    final MetalFutureSecurity future = ExposureFunctionTestHelper.getMetalFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(ExposureFunction.SECURITY_IDENTIFIER, "FUTURE_Y"), ids.get(0));
  }
View Full Code Here


    assertEquals(ExternalId.of(ExposureFunction.CONTRACT_IDENTIFIER, "Commodity"), ids.get(0));
  }

  @Test
  public void testMetalFutureSecurity() {
    final MetalFutureSecurity future = ExposureFunctionTestHelper.getMetalFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(ExposureFunction.CONTRACT_IDENTIFIER, "Commodity"), ids.get(0));
  }
View Full Code Here

    assertEquals(ExternalId.of(future.getUniqueId().getScheme(), future.getUniqueId().getValue()), ids.get(0));
  }

  @Test
  public void testMetalFutureSecurity() {
    final MetalFutureSecurity future = ExposureFunctionTestHelper.getMetalFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(future.getUniqueId().getScheme(), future.getUniqueId().getValue()), ids.get(0));
  }
View Full Code Here

    assertNull(ids);
  }

  @Test
  public void testMetalFutureSecurity() {
    final MetalFutureSecurity future = ExposureFunctionTestHelper.getMetalFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertNull(ids);
  }
View Full Code Here

  }

  public static MetalFutureSecurity makeSilverFuture() {
    Expiry expiry = new Expiry(ZonedDateTime.of(LocalDateTime.of(2010, Month.JUNE, 28, 18, 25),
        ZoneOffset.UTC), ExpiryAccuracy.MIN_HOUR_DAY_MONTH_YEAR);
    MetalFutureSecurity sec = new MetalFutureSecurity(expiry, "XCEC", "XCEC", USD, 5000, "Precious Metal");
    sec.setName("SILVER FUTURE Jun10");
    sec.setUnitNumber(5000.00);
    sec.setUnitName("troy oz.");
    Set<ExternalId> identifiers = new HashSet<>();
    identifiers.add(ExternalSchemes.bloombergBuidSecurityId("IX10217289-0"));
    identifiers.add(ExternalSchemes.cusipSecurityId("SIM10"));
    identifiers.add(ExternalSchemes.bloombergTickerSecurityId("SIM10 Comdty"));
    sec.setExternalIdBundle(ExternalIdBundle.of(identifiers));
    sec.setUniqueId(BloombergSecurityProvider.createUniqueId("IX10217289-0"));
    return sec;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.security.future.MetalFutureSecurity

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.