Examples of BondFutureDeliverable


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

    public BondFutureDeliverable convertFromString(Class<? extends BondFutureDeliverable> cls, String str) {
      List<String> ids = Lists.newArrayList();
      for (String s : str.substring(str.indexOf('[') + 1, str.lastIndexOf(']')).trim().split(",")) {
        ids.add(s.trim());
      }
      BondFutureDeliverable result = new BondFutureDeliverable();
      result.setIdentifiers(ExternalIdBundle.parse(ids));
      result.setConversionFactor(Double.parseDouble(str.substring(str.indexOf(']') + 1).trim()));
      return result;
    }
View Full Code Here

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

    ZonedDateTime lastDeliveryDate = zdt(2013, 12, 21, 11, 0, 0, 0, ZoneOffset.UTC);
    ZonedDateTime expiryDate = zdt(2013, 12, 22, 11, 0, 0, 0, ZoneOffset.UTC);
    ExternalIdBundle bundle1 = ExternalIdBundle.of(ExternalId.of("sch1", "123"), ExternalId.of("sch1", "234"));
    ExternalIdBundle bundle2 = ExternalIdBundle.of(ExternalId.of("sch1", "345"));
    List<BondFutureDeliverable> basket = Lists.newArrayList(
        new BondFutureDeliverable(bundle1, 111),
        new BondFutureDeliverable(bundle2, 222));
    BondFutureSecurity security = new BondFutureSecurity(new Expiry(expiryDate), "exch", "settExch", Currency.GBP, 1234,
                                                         basket, firstDeliveryDate, lastDeliveryDate, "category");
    security.setName("a bond future");

    // TODO this isn't converting ExternalIdBundle properly
View Full Code Here

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

   */
  public static BondFutureSecurity getBondFutureSecurity() {
    Expiry expiry = new Expiry(ZonedDateTime.of(LocalDateTime.of(2010, Month.JUNE, 21, 19, 0),
        ZoneOffset.UTC), ExpiryAccuracy.MIN_HOUR_DAY_MONTH_YEAR);
    Set<BondFutureDeliverable> basket = new HashSet<BondFutureDeliverable>();
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EV6")), 1.0858));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FB9")), 1.0132));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PX0")), 0.7984));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FG8")), 0.9169));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QD3")), 0.7771));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FF0")), 0.9174));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PW2")), 0.7825));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FE3")), 0.9454));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QH4")), 0.7757));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PU6")), 0.8675));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EX2")), 1.0765));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FT0")), 0.8054));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FJ2")), 1.0141));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PT9")), 0.8352));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QE1")), 0.8109));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FP8")), 0.9268));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QA9")), 0.6606));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FM5")), 1.0286));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EY0")), 1.0513));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QB7")), 0.7616));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QC5")), 0.795));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EZ7")), 1.0649));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EW4")), 1.0));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FA1")), 1.0396));
   
    BondFutureSecurity sec = new BondFutureSecurity(expiry, "XCBT", "XCBT", Currency.USD, 1000, basket,
                                                    LocalDate.of(2010, 6, 01).atStartOfDay(ZoneOffset.UTC),
                                                    LocalDate.of(2010, 6, 01).atStartOfDay(ZoneOffset.UTC),
View Full Code Here

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

    final List<BondFutureDeliverable> basket = bondFuture.getBasket();
    final int n = basket.size();
    final BondFixedSecurityDefinition[] deliverables = new BondFixedSecurityDefinition[n];
    final double[] conversionFactor = new double[n];
    for (int i = 0; i < n; i++) {
      final BondFutureDeliverable deliverable = basket.get(i);
      final BondSecurity bondSecurity = (BondSecurity) _securitySource.getSingle(deliverable.getIdentifiers());
      if (bondSecurity == null) {
        throw new OpenGammaRuntimeException("No security found with identifiers " + deliverable.getIdentifiers() + " in bond future deliverable basket");
      }
      deliverables[i] = (BondFixedSecurityDefinition) bondSecurity.accept(_bondConverter);
      conversionFactor[i] = deliverable.getConversionFactor();
    }
    return new BondFutureDefinition(tradingLastDate, noticeFirstDate, noticeLastDate, notional, deliverables, conversionFactor);
  }
View Full Code Here

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

        FudgeMsg deliverableContainer = (FudgeMsg) field.getValue();
        Double conversionFactor = deliverableContainer.getDouble("Conversion Factor");
        String buid = deliverableContainer.getString("Unique Bloomberg Identifier of Deliverable Bonds");
        if (conversionFactor != null && isValidField(buid)) {
          ExternalIdBundle ids = ExternalIdBundle.of(ExternalSchemes.bloombergBuidSecurityId(buid));
          BondFutureDeliverable deliverable = new BondFutureDeliverable(ids, conversionFactor);
          result.add(deliverable);
        }
      }
    }
    return result;
View Full Code Here

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

        break;
      // Note: MunicipalBondSecurity is not implemented
      default:
        throw new IllegalStateException();
    }
    return new BondFutureDeliverable(identifiers, 1.0);
  }
View Full Code Here

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

    final Set<ExternalId> identifiers = new HashSet<ExternalId>(
      identifierBeans.size());
    for (ExternalIdBean identifierBean : identifierBeans) {
      identifiers.add(externalIdBeanToExternalId(identifierBean));
    }
    return new BondFutureDeliverable(ExternalIdBundle.of(identifiers),
      futureBundleBean.getConversionFactor());
  }
View Full Code Here

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

  public static BondFutureSecurity makeEuroBundFuture() {
    Expiry expiry = new Expiry(ZonedDateTime.of(LocalDateTime.of(2010, Month.JUNE, 8, 21, 0), ZoneOffset.UTC),
                               ExpiryAccuracy.MIN_HOUR_DAY_MONTH_YEAR);
    Set<BondFutureDeliverable> basket = new HashSet<>();
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("COEH8262261")), 0.828936d));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("COEI0354262")), 0.80371d));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("COEI2292098")), 0.777869d));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("COEH6142705")), 0.852328d));
   
    BondFutureSecurity sec = new BondFutureSecurity(expiry, "XEUR", "XEUR", EUR, 1000, basket,
                                                    LocalDateTime.of(2010, 6, 10, 0, 0, 0, 0).atZone(ZoneOffset.UTC),
                                                    LocalDateTime.of(2010, 6, 10, 0, 0, 0, 0).atZone(ZoneOffset.UTC),
View Full Code Here

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

 
  public static BondFutureSecurity makeUSBondFuture() {
    Expiry expiry = new Expiry(ZonedDateTime.of(LocalDateTime.of(2010, Month.JUNE, 21, 20, 0), ZoneOffset.UTC),
                               ExpiryAccuracy.MIN_HOUR_DAY_MONTH_YEAR);
    Set<BondFutureDeliverable> basket = new HashSet<>();
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EV6")), 1.0858));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FB9")), 1.0132));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PX0")), 0.7984));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FG8")), 0.9169));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QD3")), 0.7771));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FF0")), 0.9174));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PW2")), 0.7825));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FE3")), 0.9454));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QH4")), 0.7757));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PU6")), 0.8675));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EX2")), 1.0765));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FT0")), 0.8054));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FJ2")), 1.0141));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810PT9")), 0.8352));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QE1")), 0.8109));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FP8")), 0.9268));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QA9")), 0.6606));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FM5")), 1.0286));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EY0")), 1.0513));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QB7")), 0.7616));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810QC5")), 0.795));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EZ7")), 1.0649));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810EW4")), 1.0));
    basket.add(new BondFutureDeliverable(ExternalIdBundle.of(
        ExternalSchemes.bloombergBuidSecurityId("GV912810FA1")), 1.0396));
   
    BondFutureSecurity sec = new BondFutureSecurity(expiry, "XCBT", "XCBT", USD, 100000, basket,
                                                    LocalDateTime.of(2010, 6, 01, 0, 0, 0, 0).atZone(ZoneOffset.UTC),
                                                    LocalDateTime.of(2010, 6, 30, 0, 0, 0, 0).atZone(ZoneOffset.UTC),
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.