Package com.opengamma.financial.security.fx

Examples of com.opengamma.financial.security.fx.FXForwardSecurity.addExternalId()


    sb.append("/");
    sb.append(receiveCurrency);
    sb.append(" @ ");
    sb.append(FORMATTER.format(forwardRate));
    final FXForwardSecurity fxForward = new FXForwardSecurity(payCurrency, payAmount, receiveCurrency, receiveAmount, forwardDate, REGION);
    fxForward.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    fxForward.setName(sb.toString());
    return fxForward;
  }

  private LocalDate getTradeDate(final Random random, final Currency ccy) {
View Full Code Here


    final List<FinancialSecurity> securities = new ArrayList<FinancialSecurity>();
    int year = TODAY.getYear();
    final FXForwardSecurity fxForward1 = new FXForwardSecurity(Currency.USD, 1000000, Currency.EUR, 1000000,
        ZonedDateTime.of(LocalDateTime.of(year + 1, 2, 1, 11, 0), ZoneOffset.UTC),
        ExternalSchemes.countryRegionId(Country.of("US")));
    fxForward1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    fxForward1.setName("FX forward, pay USD 1000000, receive EUR 1000000, maturity=" + fxForward1.getForwardDate().toLocalDate());
    final FXForwardSecurity fxForward2 = new FXForwardSecurity(Currency.CHF, 2000000, Currency.EUR, 1000000,
        ZonedDateTime.of(LocalDateTime.of(year + 1, 2, 1, 11, 0), ZoneOffset.UTC),
        ExternalSchemes.countryRegionId(Country.of("US")));
    fxForward2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
View Full Code Here

    fxForward1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    fxForward1.setName("FX forward, pay USD 1000000, receive EUR 1000000, maturity=" + fxForward1.getForwardDate().toLocalDate());
    final FXForwardSecurity fxForward2 = new FXForwardSecurity(Currency.CHF, 2000000, Currency.EUR, 1000000,
        ZonedDateTime.of(LocalDateTime.of(year + 1, 2, 1, 11, 0), ZoneOffset.UTC),
        ExternalSchemes.countryRegionId(Country.of("US")));
    fxForward2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    fxForward2.setName("FX forward, pay CHF 2000000, receive EUR 1000000, maturity=" + fxForward2.getForwardDate().toLocalDate());
    securities.add(fxForward1);
    securities.add(fxForward2);
    return securities;
  }
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.