Examples of Tenor


Examples of com.opengamma.util.time.Tenor

      return message;
    }

    @Override
    public SwapNode 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 payLegConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(PAY_LEG_CONVENTION_FIELD));
      final ExternalId receiveLegConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(RECEIVE_LEG_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

Examples of com.opengamma.util.time.Tenor

      return message;
    }

    @Override
    public ZeroCouponInflationNode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final Tenor tenor = Tenor.of(Period.parse(message.getString(TENOR_FIELD)));
      final ExternalId inflationConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(INFLATION_CONVENTION_FIELD));
      final ExternalId fixedConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(FIXED_CONVENTION_FIELD));
      final InflationNodeType inflationNodeType = InflationNodeType.valueOf(message.getString(INFLATION_NODE_TYPE_FIELD));
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      if (message.hasField(NAME_FIELD)) {
View Full Code Here

Examples of com.opengamma.util.time.Tenor

      final ExternalIdBundle externalIdBundle = deserializer.fieldValueToObject(ExternalIdBundle.class, message.getByName(EXTERNAL_ID_BUNDLE_FIELD));
      final ExternalId iborIndexConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(IBOR_INDEX_CONVENTION_FIELD));
      final boolean isAdvanceFixing = message.getBoolean(ADVANCE_FIXING_FIELD);
      final StubType stubType = StubType.valueOf(message.getString(STUB_TYPE_FIELD));
      final String interpolatorName = message.getString(INTERPOLATOR_NAME_FIELD);
      final Tenor resetTenor = Tenor.of(Period.parse(message.getString(RESET_TENOR_FIELD)));
      final int settlementDays = message.getInt(SETTLEMENT_DAYS_FIELD);
      final boolean isEOM = message.getBoolean(IS_EOM_FIELD);
      final boolean exchangeNotional = message.getBoolean(EXCHANGE_NOTIONAL_FIELD);
      final int paymentLag = message.getInt(PAYMENT_LAG_FIELD);
      final VanillaIborLegConvention convention = new VanillaIborLegConvention(name, externalIdBundle, iborIndexConvention, isAdvanceFixing, interpolatorName,
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    final Currency currency = getRandomCurrency();
    final boolean payer = getRandom().nextBoolean();
    final boolean cap = getRandom().nextBoolean();
    final ZonedDateTime startDate = previousWorkingDay(ZonedDateTime.now().minusDays(getRandom(365) + 7), currency);
    final double notional = (double) getRandom(100000) * 1000;
    Tenor tenor1;
    Tenor tenor2;
    do {
      tenor1 = getRandom(SHORT_TENORS);
      tenor2 = getRandom(LONG_TENORS);
    } while (tenor1.compareTo(tenor2) >= 0);
    final int length = getRandom(tenor2.getPeriod().getYears() - 5) + 3;
    final ZonedDateTime maturityDate = nextWorkingDay(startDate.plusYears(length), currency);
    final ExternalId shortIdentifier = getUnderlying(currency, startDate.toLocalDate(), tenor1);
    final ExternalId longIdentifier = getUnderlying(currency, startDate.toLocalDate(), tenor2);
    final double strike = getRandom(STRIKES);
    final Frequency frequency = getRandom(FREQUENCY);
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    final Currency target = deserializer.fieldValueToObject(Currency.class, message.getByName(TARGET_FIELD));
    final String name = message.getString(NAME_FIELD);
    final List<FudgeField> tenorFields = message.getAllByName(TENOR_FIELD);
    final List<Tenor> tenors = new ArrayList<Tenor>();
    for (final FudgeField tenorField : tenorFields) {
      final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, tenorField);
      tenors.add(tenor);
    }
    return new ForwardSwapCurveDefinition(name, target, tenors.toArray(new Tenor[0]));
  }
View Full Code Here

Examples of com.opengamma.util.time.Tenor

  @Override
  public FixedIncomeStrip buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
    final StripInstrumentType type = deserializer.fieldValueToObject(StripInstrumentType.class, message.getByName(TYPE));
    final String conventionName = message.getString(CONVENTION_NAME);
    final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(TENOR));
    if (type == StripInstrumentType.FUTURE) {
      final int numFutures = message.getInt(NUM_FUTURES);
      return new FixedIncomeStrip(type, tenor, numFutures, conventionName);
    } else if (type == StripInstrumentType.PERIODIC_ZERO_DEPOSIT) {
      final int periodsPerYear = message.getInt(PERIODS_PER_YEAR);
      return new FixedIncomeStrip(type, tenor, periodsPerYear, true, conventionName);
    } else if (message.hasField(RESET_TENOR)) {
      final Tenor resetTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(RESET_TENOR));
      final IndexType indexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(INDEX_TYPE));
      return new FixedIncomeStrip(type, tenor, resetTenor, indexType, conventionName);
    } else if (type == StripInstrumentType.BASIS_SWAP) {
      final Tenor payTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(PAY_TENOR));
      final Tenor receiveTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(RECEIVE_TENOR));
      final IndexType payIndexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(PAY_INDEX_TYPE));
      final IndexType receiveIndexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(RECEIVE_INDEX_TYPE));
      return new FixedIncomeStrip(type, tenor, payTenor, receiveTenor, payIndexType, receiveIndexType, conventionName);
    } else {
      return new FixedIncomeStrip(type, tenor, conventionName);
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    final UnorderedCurrencyPair target = deserializer.fieldValueToObject(UnorderedCurrencyPair.class, message.getByName("target"));
    final String name = message.getString("name");
    final List<FudgeField> tenorFields = message.getAllByName("tenor");
    final List<Tenor> tenors = new ArrayList<Tenor>();
    for (final FudgeField tenorField : tenorFields) {
      final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, tenorField);
      tenors.add(tenor);
    }
    return new FXForwardCurveDefinition(name, target, tenors.toArray(new Tenor[0]));
  }
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    for (int i = 0; i < SIZE; i++) {
      Pair<SwaptionSecurity, SwapSecurity> pair = null;
      try {
        final Currency ccy = CCYS[random.nextInt(CCYS.length)];
        final LocalDate tradeDate = getTradeDate(random, ccy);
        final Tenor swaptionExpiry = EXPIRIES[random.nextInt(EXPIRIES.length)];
        final Tenor swapMaturity = MATURITIES[random.nextInt(MATURITIES.length)];
        pair = makeSwaptionAndUnderlying(random, ccy, tradeDate, swaptionExpiry, swapMaturity);
      } catch (final Exception e) {
        e.printStackTrace();
      }
      if (pair != null) {
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    for (int i = 0; i < SIZE; i++) {
      FXForwardSecurity fxForward = null;
      try {
        final UnorderedCurrencyPair ccys = CCYS[random.nextInt(CCYS.length)];
        final LocalDate tradeDate = getTradeDate(random, ccys.getFirstCurrency());
        final Tenor tenor = TENORS[random.nextInt(TENORS.length)];
        fxForward = makeFXForward(random, ccys, tradeDate, tenor);
      } catch (final Exception e) {
        e.printStackTrace();
      }
      if (fxForward != null) {
View Full Code Here

Examples of com.opengamma.util.time.Tenor

    final CurveSpecificationBuilderConfiguration curveSpecConfig = getCurrencyCurveConfig(ccy);
    if (curveSpecConfig == null) {
      return null;
    }
    final ExternalId swapSecurity;
    final Tenor tenor;
    final int months = (int) maturityTenor.getPeriod().toTotalMonths() + (int) forwardTenor.getPeriod().toTotalMonths();
    if (months < 12) {
      tenor = Tenor.ofMonths(months);
    } else {
      // TODO: this isn't particularly great
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.