Examples of StubType


Examples of com.opengamma.analytics.financial.credit.StubType

    for (int i = 0; i < n; i++) {
      coupons[i] /= 10000;
    }

    final Period tenor = Period.ofMonths(3);
    final StubType stubType = StubType.FRONTSHORT;
    final boolean payAccOndefault = true;
    final boolean protectionStart = true;
    final double recovery = 0.4;

    final ISDACompliantCurveCalibrator calibrator = new ISDACompliantCurveCalibrator();
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.StubType

  @Override
  public CDSAnalytic visitLegacyVanillaCDSSecurity(final LegacyVanillaCDSSecurity security) {
    final ExternalId regionId = security.getRegionId();
    final Calendar calendar = new HolidaySourceCalendarAdapter(_holidaySource, _regionSource.getHighestLevelRegion(regionId));
    final StubType stubType = security.getStubType().toAnalyticsType();
    final Period period = (IMMDateGenerator.isIMMDate(security.getMaturityDate())) ? getPeriodFrequency(security.getCouponFrequency()).getPeriod() :
        Period.ofMonths(6); // non IMM forced to semi annual
    final CDSAnalytic cdsAnalytic = new CDSAnalytic(_valuationDate,
                                                    security.getEffectiveDate().toLocalDate(),
                                                    // Hard code or get from somewhere?
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

      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));
      final boolean exchangeNotional = message.getBoolean(EXCHANGE_NOTIONAL_FIELD);
      final OISLegConvention convention = new OISLegConvention(name, externalIdBundle, overnightIndexConvention, paymentTenor,
          businessDayConvention, settlementDays, isEOM, stubType, exchangeNotional, paymentLag);
      final FudgeField uniqueIdMsg = message.getByName(UNIQUE_ID_FIELD);
      if (uniqueIdMsg != null) {
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

      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));
      final ExternalId regionCalendar = deserializer.fieldValueToObject(ExternalId.class, message.getByName(REGION_FIELD));
      final StubType stubType = StubType.valueOf(message.getString(STUB_TYPE_FIELD));
      final boolean exchangeNotional = message.getBoolean(EXCHANGE_NOTIONAL_FIELD);
      final int paymentLag = message.getInt(PAYMENT_LAG_FIELD);
      final SwapFixedLegConvention convention = new SwapFixedLegConvention(name, externalIdBundle, paymentTenor, dayCount, businessDayConvention, currency,
          regionCalendar, settlementDays, isEOM, stubType, exchangeNotional, paymentLag);
      final FudgeField uniqueIdMsg = message.getByName(UNIQUE_ID_FIELD);
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    public VanillaIborLegConvention 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 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);
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

      final ZonedDateTime nextCouponDate, final double coupon, final double paymentsPerYear, final boolean isEndOfMonthConvention) {
    if (dayCount instanceof ActualActualICMANormal) {
      if (isEndOfMonthConvention) {
        throw new IllegalArgumentException("Inconsistent definition; asked for accrual with EOM convention but are not using Actual/Actual ICMA");
      }
      final StubType stubType = getStubType(index, length, previousCouponDate, nextCouponDate, paymentsPerYear, isEndOfMonthConvention);
      return ((ActualActualICMANormal) dayCount).getAccruedInterest(previousCouponDate, date, nextCouponDate, coupon, paymentsPerYear, stubType);

    } else if (dayCount instanceof ActualActualICMA) {
      final StubType stubType = getStubType(index, length, previousCouponDate, nextCouponDate, paymentsPerYear, isEndOfMonthConvention);
      return ((ActualActualICMA) dayCount).getAccruedInterest(previousCouponDate, date, nextCouponDate, coupon, paymentsPerYear, stubType);

    } else if (dayCount instanceof ThirtyUThreeSixty) {
      return ((ThirtyUThreeSixty) dayCount).getAccruedInterest(previousCouponDate, date, coupon, isEndOfMonthConvention);
    }
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

      final LocalDate nextCouponDate, final double coupon, final double paymentsPerYear, final boolean isEndOfMonthConvention) {
    if (dayCount instanceof ActualActualICMANormal) {
      if (isEndOfMonthConvention) {
        throw new IllegalArgumentException("Inconsistent definition; asked for accrual with EOM convention but are not using Actual/Actual ICMA");
      }
      final StubType stubType = getStubType(index, length, previousCouponDate, nextCouponDate, paymentsPerYear, isEndOfMonthConvention);
      return ((ActualActualICMANormal) dayCount).getAccruedInterest(previousCouponDate, date, nextCouponDate, coupon, paymentsPerYear, stubType);

    } else if (dayCount instanceof ActualActualICMA) {
      final StubType stubType = getStubType(index, length, previousCouponDate, nextCouponDate, paymentsPerYear, isEndOfMonthConvention);
      return ((ActualActualICMA) dayCount).getAccruedInterest(previousCouponDate, date, nextCouponDate, coupon, paymentsPerYear, stubType);

    } else if (dayCount instanceof ThirtyUThreeSixty) {
      return ((ThirtyUThreeSixty) dayCount).getAccruedInterest(previousCouponDate, date, coupon, isEndOfMonthConvention);
    }
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    return dayCount.getAccruedInterest(previousCouponDate, date, nextCouponDate, coupon, paymentsPerYear);
  }

  private static StubType getStubType(final int index, final int length, final ZonedDateTime previousCouponDate, final ZonedDateTime nextCouponDate, final double paymentsPerYear,
      final boolean isEndOfMonthConvention) {
    StubType stubType;
    if (index == 0) {
      LocalDate[] schedule = new LocalDate[] {previousCouponDate.toLocalDate(), nextCouponDate.toLocalDate()};
      stubType = StubCalculator.getStartStubType(schedule, paymentsPerYear, isEndOfMonthConvention);

    } else if (index == length - 2) {
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    return stubType;
  }

  private static StubType getStubType(final int index, final int length, final LocalDate previousCouponDate, final LocalDate nextCouponDate, final double paymentsPerYear,
      final boolean isEndOfMonthConvention) {
    StubType stubType;
    if (index == 0) {
      LocalDate[] schedule = new LocalDate[] {previousCouponDate, nextCouponDate};
      stubType = StubCalculator.getStartStubType(schedule, paymentsPerYear, isEndOfMonthConvention);

    } else if (index == length - 2) {
View Full Code Here

Examples of com.opengamma.financial.convention.StubType

    final boolean eomLeg = convention.isIsEOM();
    final int spotLagLeg = convention.getSettlementDays();
    final ZonedDateTime spotDateLeg = ScheduleCalculator.getAdjustedDate(_valuationTime, spotLagLeg, calendar);
    final ZonedDateTime startDate = ScheduleCalculator.getAdjustedDate(spotDateLeg, swapNode.getStartTenor().getPeriod(), businessDayConvention, calendar, eomLeg);
    final Period maturityTenor = swapNode.getMaturityTenor().getPeriod();
    final StubType stub = convention.getStubType();
    final ZonedDateTime maturityDate = startDate.plus(maturityTenor);
    final Period paymentPeriod = convention.getPaymentTenor().getPeriod();
    return AnnuityCouponFixedDefinition.from(currency, startDate, maturityDate, paymentPeriod, calendar, dayCount, businessDayConvention, eomLeg, 1, rate, isPayer, stub);       
  }
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.