Package com.opengamma.util.time

Examples of com.opengamma.util.time.Tenor


    @Override
    public OISLegConvention buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String name = message.getString(NAME_FIELD);
      final ExternalIdBundle externalIdBundle = deserializer.fieldValueToObject(ExternalIdBundle.class, message.getByName(EXTERNAL_ID_BUNDLE_FIELD));
      final ExternalId overnightIndexConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(OVERNIGHT_INDEX_CONVENTION_FIELD));
      final Tenor paymentTenor = Tenor.of(Period.parse(message.getString(PAYMENT_TENOR_FIELD)));
      final int paymentLag = message.getInt(PAYMENT_LAG_FIELD);
      final int settlementDays = message.getInt(SETTLEMENT_DAYS_FIELD);
      final BusinessDayConvention businessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention(message.getString(BUSINESS_DAY_CONVENTION_FIELD));
      final boolean isEOM = message.getBoolean(IS_EOM_FIELD);
      final StubType stubType = StubType.valueOf(message.getString(STUB_TYPE_FIELD));
View Full Code Here


  private Collection<FinancialSecurity> createRandomSwaps(final Random random, final int n) {
    final Collection<FinancialSecurity> securities = new HashSet<>();
    for (int i = 0; i < n; i++) {
      FinancialSecurity security = null;
      try {
        final Tenor tenor = TENORS[random.nextInt(TENORS.length)];
        security = makeSwap(random, tenor);
      } catch (final Exception e) {
        e.printStackTrace();
      }
      if (security != null) {
View Full Code Here

  private Collection<FinancialSecurity> createRandomCapFloors(final Random random, final int n) {
    final Collection<FinancialSecurity> securities = new HashSet<>();
    for (int i = 0; i < n; i++) {
      FinancialSecurity security = null;
      try {
        final Tenor tenor = TENORS[random.nextInt(TENORS.length)];
        security = makeCapFloor(random, tenor);
      } catch (final Exception e) {
        e.printStackTrace();
      }
      if (security != null) {
View Full Code Here

  private Collection<FinancialSecurity> createRandomCapFloorCMSSpreads(final Random random, final int n) {
    final Collection<FinancialSecurity> securities = new HashSet<>();
    for (int i = 0; i < n; i++) {
      FinancialSecurity security = null;
      try {
        final Tenor tenor = TENORS[random.nextInt(TENORS.length)];
        final Tenor payTenor = PAY_TENORS[random.nextInt(PAY_TENORS.length)];
        final Tenor receiveTenor = RECEIVE_TENORS[random.nextInt(RECEIVE_TENORS.length)];
        security = makeCMSCapFloorSpread(random, payTenor, receiveTenor, tenor, i);
      } catch (final Exception e) {
        e.printStackTrace();
      }
      if (security != null) {
View Full Code Here

    @Override
    public SwapFixedLegConvention buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String name = message.getString(NAME_FIELD);
      final ExternalIdBundle externalIdBundle = deserializer.fieldValueToObject(ExternalIdBundle.class, message.getByName(EXTERNAL_ID_BUNDLE_FIELD));
      final Tenor paymentTenor = Tenor.of(Period.parse(message.getString(PAYMENT_TENOR)));
      final DayCount dayCount = DayCountFactory.INSTANCE.getDayCount(message.getString(DAY_COUNT_FIELD));
      final BusinessDayConvention businessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention(message.getString(BUSINESS_DAY_CONVENTION_FIELD));
      final int settlementDays = message.getInt(SETTLEMENT_DAYS_FIELD);
      final boolean isEOM = message.getBoolean(IS_EOM_FIELD);
      final Currency currency = Currency.of(message.getString(CURRENCY_FIELD));
View Full Code Here

    @Override
    public CDSIndexTerms convertFromString(Class<? extends CDSIndexTerms> cls, String str) {
      String[] tenorStrs = str.split(",");
      Tenor[] tenors = new Tenor[tenorStrs.length];
      for (int i = 0; i < tenorStrs.length; i++) {
        Tenor tenor = Tenor.parse(tenorStrs[i]);
        tenors[i] = tenor;
      }
      return CDSIndexTerms.of(tenors);
    }
View Full Code Here

    @Override
    public DiscountFactorNode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      //TODO should just use the period string for Tenor
      final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(TENOR_FIELD));
      if (message.hasField(NAME_FIELD)) {
        final String name = message.getString(NAME_FIELD);
        return new DiscountFactorNode(curveNodeIdMapperName, tenor, name);
      }
      return new DiscountFactorNode(curveNodeIdMapperName, tenor);
View Full Code Here

    }

    @Override
    public FRANode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      final Tenor fixingStart = Tenor.of(Period.parse(message.getString(FIXING_START_FIELD)));
      final Tenor fixingEnd = Tenor.of(Period.parse(message.getString(FIXING_END_FIELD)));
      final ExternalId conventionId = deserializer.fieldValueToObject(ExternalId.class, message.getByName(CONVENTION_ID_FIELD));
      if (message.hasField(NAME_FIELD)) {
        final String name = message.getString(NAME_FIELD);
        return new FRANode(fixingStart, fixingEnd, conventionId, curveNodeIdMapperName, name);
      }
View Full Code Here

      return message;
    }

    @Override
    public FXForwardNode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final Tenor startTenor = Tenor.of(Period.parse(message.getString(START_TENOR_FIELD)));
      final Tenor maturityTenor = Tenor.of(Period.parse(message.getString(MATURITY_TENOR_FIELD)));
      final ExternalId fxForwardConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(CONVENTION_FIELD));
      final Currency payCurrency = Currency.of(message.getString(PAY_CURRENCY_FIELD));
      final Currency receiveCurrency = Currency.of(message.getString(RECEIVE_CURRENCY_FIELD));
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      if (message.hasField(NAME_FIELD)) {
View Full Code Here

    }

    @Override
    public RateFutureNode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final int futureNumber = message.getInt(FUTURE_NUMBER_FIELD);
      final Tenor startTenor = Tenor.of(Period.parse(message.getString(START_TENOR_FIELD)));
      final Tenor futureTenor = Tenor.of(Period.parse(message.getString(FUTURE_TENOR_FIELD)));
      final Tenor underlyingTenor = Tenor.of(Period.parse(message.getString(UNDERLYING_TENOR_FIELD)));
      final ExternalId futureConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(FUTURE_CONVENTION_FIELD));
      final ExternalId underlyingConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(UNDERLYING_CONVENTION_FIELD));
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      if (message.hasField(NAME_FIELD)) {
        final String name = message.getString(NAME_FIELD);
View Full Code Here

TOP

Related Classes of com.opengamma.util.time.Tenor

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.