Package com.opengamma.analytics.financial.instrument.annuity

Examples of com.opengamma.analytics.financial.instrument.annuity.AnnuityCouponFixedDefinition


      final DayCount fixedLegDayCount, final int conventionalMonthLag, final int monthLag, final boolean payNotional) {
    ArgumentChecker.notNull(priceIndex, "Price index");
    ArgumentChecker.notNull(settlementDate, "Settlement date");
    ArgumentChecker.notNull(businessDayConvention, "Business day convention");
    ArgumentChecker.notNull(calendar, "Calendar");
    final AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from(priceIndex.getCurrency(), settlementDate, Period.ofYears(tenor), paymentPeriod, calendar,
        fixedLegDayCount, businessDayConvention, endOfMonth, notional, fixedRate, isPayer);
    final AnnuityCouponInflationYearOnYearMonthlyDefinition inflationLeg = AnnuityCouponInflationYearOnYearMonthlyDefinition.from(priceIndex, settlementDate, notional, Period.ofYears(tenor),
        paymentPeriod, businessDayConvention, calendar, endOfMonth, conventionalMonthLag, monthLag, payNotional);
    return new SwapFixedInflationYearOnYearDefinition(fixedLeg, inflationLeg);
  }
View Full Code Here


  public static SwapFixedInflationYearOnYearDefinition fromGeneratorMonthly(final ZonedDateTime settlementDate, final double fixedRate, final double notional, final Period tenor,
      final GeneratorSwapFixedInflationYearOnYear generator, final boolean isPayer) {
    ArgumentChecker.notNull(settlementDate, "Settlement date");
    ArgumentChecker.notNull(generator, "generator");
    ArgumentChecker.notNull(tenor, "tenor");
    final AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from(generator.getIndexPrice().getCurrency(), settlementDate, tenor, generator.getFixedLegPeriod(),
        generator.getCalendar(), generator.getFixedLegDayCount(), generator.getBusinessDayConvention(), generator.isEndOfMonth(), notional, fixedRate, isPayer);
    final AnnuityCouponInflationYearOnYearMonthlyDefinition inflationLeg = AnnuityCouponInflationYearOnYearMonthlyDefinition.from(generator.getIndexPrice(), settlementDate, notional,
        tenor, generator.getFixedLegPeriod(), generator.getBusinessDayConvention(), generator.getCalendar(), generator.isEndOfMonth(), generator.getMonthLag(), generator.getMonthLag(),
        generator.payNotional());
    return new SwapFixedInflationYearOnYearDefinition(fixedLeg, inflationLeg);
View Full Code Here

      final DayCount fixedLegDayCount, final int conventionalMonthLag, final int monthLag, final boolean payNotional) {
    ArgumentChecker.notNull(priceIndex, "Price index");
    ArgumentChecker.notNull(settlementDate, "Settlement date");
    ArgumentChecker.notNull(businessDayConvention, "Business day convention");
    ArgumentChecker.notNull(calendar, "Calendar");
    final AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from(priceIndex.getCurrency(), settlementDate, tenor, paymentPeriod, calendar,
        fixedLegDayCount, businessDayConvention, endOfMonth, notional, fixedRate, isPayer);
    final AnnuityCouponInflationYearOnYearInterpolationDefinition inflationLeg = AnnuityCouponInflationYearOnYearInterpolationDefinition.from(priceIndex, settlementDate, notional,
        tenor, paymentPeriod, businessDayConvention, calendar, endOfMonth, conventionalMonthLag, monthLag, payNotional);
    return new SwapFixedInflationYearOnYearDefinition(fixedLeg, inflationLeg);
  }
View Full Code Here

  public static SwapFixedInflationYearOnYearDefinition fromGeneratorInterpolation(final ZonedDateTime settlementDate, final double fixedRate, final double notional, final Period tenor,
      final GeneratorSwapFixedInflationYearOnYear generator, final boolean isPayer) {
    ArgumentChecker.notNull(settlementDate, "Settlement date");
    ArgumentChecker.notNull(generator, "generator");
    ArgumentChecker.notNull(tenor, "tenor");
    final AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from(generator.getIndexPrice().getCurrency(), settlementDate, tenor, generator.getFixedLegPeriod(),
        generator.getCalendar(), generator.getFixedLegDayCount(), generator.getBusinessDayConvention(), generator.isEndOfMonth(), notional, fixedRate, isPayer);
    final AnnuityCouponInflationYearOnYearInterpolationDefinition inflationLeg = AnnuityCouponInflationYearOnYearInterpolationDefinition.from(generator.getIndexPrice(), settlementDate,
        notional, tenor, generator.getFixedLegPeriod(), generator.getBusinessDayConvention(), generator.getCalendar(), generator.isEndOfMonth(), generator.getMonthLag(), generator.getMonthLag(),
        generator.payNotional());
    return new SwapFixedInflationYearOnYearDefinition(fixedLeg, inflationLeg);
View Full Code Here

    ArgumentChecker.notNull(paymentPeriod, "Payment period");
    ArgumentChecker.notNull(calendar, "Calendar");
    ArgumentChecker.notNull(dayCount, "Day count");
    ArgumentChecker.notNull(businessDay, "Business day convention");
    ArgumentChecker.notNull(yieldConvention, "Yield convention");
    AnnuityCouponFixedDefinition coupon;
    if ((dayCount instanceof ActualActualICMA) || (dayCount instanceof ActualActualICMANormal)) {
      final int couponPerYear = (int) Math.round(365.0 / (firstAccrualDate.plus(paymentPeriod).getLong(JulianFields.MODIFIED_JULIAN_DAY) - firstAccrualDate
          .getLong(JulianFields.MODIFIED_JULIAN_DAY)));
      coupon = AnnuityCouponFixedDefinition.fromAccrualUnadjusted(currency, firstAccrualDate, maturityDate, paymentPeriod, couponPerYear, true, true, calendar, dayCount,
          businessDay, isEOM, DEFAULT_NOTIONAL, rate, false);
View Full Code Here

        dayCount, businessDay, isEOM, DEFAULT_NOTIONAL, rate, false).getPayments();
    final CouponFixedDefinition[] allCoupons = new CouponFixedDefinition[couponAfterFirst.length + 1];
    allCoupons[0] = new CouponFixedDefinition(currency, businessDay.adjustDate(calendar, firstCouponDate), firstAccrualDate, firstCouponDate, firstCouponAccrual, DEFAULT_NOTIONAL,
        rate);
    System.arraycopy(couponAfterFirst, 0, allCoupons, 1, couponAfterFirst.length);
    final AnnuityCouponFixedDefinition coupons = new AnnuityCouponFixedDefinition(allCoupons, calendar);
    final PaymentFixedDefinition[] nominalPayment = new PaymentFixedDefinition[] {new PaymentFixedDefinition(currency, businessDay.adjustDate(calendar, maturityDate),
        DEFAULT_NOTIONAL) };
    final AnnuityPaymentFixedDefinition nominal = new AnnuityPaymentFixedDefinition(nominalPayment, calendar);
    return new BondFixedSecurityDefinition(nominal, coupons, DEFAULT_EX_COUPON_DAYS, settlementDays, calendar, dayCount, yieldConvention, isEOM, issuer);
  }
View Full Code Here

    ArgumentChecker.notNull(dayCount, "Day count");
    ArgumentChecker.notNull(businessDay, "Business day convention");
    ArgumentChecker.notNull(yieldConvention, "Yield convention");
    ArgumentChecker.notNull(issuer, "Issuer");
    ArgumentChecker.notNull(repoType, "Repo type");
    AnnuityCouponFixedDefinition coupon;
    if ((dayCount instanceof ActualActualICMA) || (dayCount instanceof ActualActualICMANormal)) {
      final int couponPerYear = (int) Math.round(365.0 / (firstAccrualDate.plus(paymentPeriod).getLong(JulianFields.MODIFIED_JULIAN_DAY) - firstAccrualDate
          .getLong(JulianFields.MODIFIED_JULIAN_DAY)));
      coupon = AnnuityCouponFixedDefinition.fromAccrualUnadjusted(currency, firstAccrualDate, maturityDate, paymentPeriod, couponPerYear, true, true, calendar, dayCount,
          businessDay, isEOM, notional, rate, false);
View Full Code Here

    } else {
      settleTime = TimeCalculator.getTimeBetween(date, settlementDate);
      accruedInterestAtSettle = accruedInterest(settlementDate);
    }
    final AnnuityPaymentFixed nominal = (AnnuityPaymentFixed) getNominal().toDerivative(date, creditCurveName);
    AnnuityCouponFixedDefinition couponDefinition = getCoupons();
    couponDefinition = getCoupons().trimBefore(settlementDate);
    final CouponFixedDefinition[] couponExPeriodArray = new CouponFixedDefinition[couponDefinition.getNumberOfPayments()];
    System.arraycopy(couponDefinition.getPayments(), 0, couponExPeriodArray, 0, couponDefinition.getNumberOfPayments());
    if (getExCouponDays() != 0) {
      final ZonedDateTime exDividendDate = ScheduleCalculator.getAdjustedDate(couponDefinition.getNthPayment(0).getPaymentDate(), -getExCouponDays(), getCalendar());
      if (settlementDate.isAfter(exDividendDate)) {
        // Implementation note: Ex-dividend period: the next coupon is not received but its date is required for yield calculation
        couponExPeriodArray[0] = new CouponFixedDefinition(couponDefinition.getNthPayment(0), 0.0);
      }
    }
    final AnnuityCouponFixedDefinition couponDefinitionExPeriod = new AnnuityCouponFixedDefinition(couponExPeriodArray, getCalendar());
    final AnnuityCouponFixed couponStandard = couponDefinitionExPeriod.toDerivative(date, yieldCurveNames);
    final AnnuityPaymentFixed nominalStandard = nominal.trimBefore(settleTime);
    final double factorSpot = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), settlementDate,
        couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
    final double factorPeriod = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(),
        couponDefinition.getNthPayment(0).getAccrualEndDate(), couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
View Full Code Here

    } else {
      settleTime = TimeCalculator.getTimeBetween(date, settlementDate);
      accruedInterestAtSettle = accruedInterest(settlementDate);
    }
    final AnnuityPaymentFixed nominal = (AnnuityPaymentFixed) getNominal().toDerivative(date);
    AnnuityCouponFixedDefinition couponDefinition = getCoupons();
    couponDefinition = getCoupons().trimBefore(settlementDate);
    final CouponFixedDefinition[] couponExPeriodArray = new CouponFixedDefinition[couponDefinition.getNumberOfPayments()];
    System.arraycopy(couponDefinition.getPayments(), 0, couponExPeriodArray, 0, couponDefinition.getNumberOfPayments());
    if (getExCouponDays() != 0) {
      final ZonedDateTime exDividendDate = ScheduleCalculator.getAdjustedDate(couponDefinition.getNthPayment(0).getPaymentDate(), -getExCouponDays(), getCalendar());
      if (settlementDate.isAfter(exDividendDate)) {
        // Implementation note: Ex-dividend period: the next coupon is not received but its date is required for yield calculation
        couponExPeriodArray[0] = new CouponFixedDefinition(couponDefinition.getNthPayment(0), 0.0);
      }
    }
    final AnnuityCouponFixedDefinition couponDefinitionExPeriod = new AnnuityCouponFixedDefinition(couponExPeriodArray, getCalendar());
    final AnnuityCouponFixed couponStandard = couponDefinitionExPeriod.toDerivative(date);
    final AnnuityPaymentFixed nominalStandard = nominal.trimBefore(settleTime);
    final double factorSpot = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), settlementDate,
        couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
    final double factorPeriod = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(),
        couponDefinition.getNthPayment(0).getAccrualEndDate(), couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
View Full Code Here

    final CouponFixedDefinition[] cpnFixed = new CouponFixedDefinition[oisLeg.getNumberOfPayments()];
    for (int loopcpn = 0; loopcpn < oisLeg.getNumberOfPayments(); loopcpn++) {
      cpnFixed[loopcpn] = new CouponFixedDefinition(oisLeg.getCurrency(), oisLeg.getNthPayment(loopcpn).getPaymentDate(), oisLeg.getNthPayment(loopcpn).getAccrualStartDate(), oisLeg.getNthPayment(
          loopcpn).getAccrualEndDate(), oisLeg.getNthPayment(loopcpn).getPaymentYearFraction(), notionalSigned, fixedRate);
    }
    return new SwapFixedONDefinition(new AnnuityCouponFixedDefinition(cpnFixed, calendar), oisLeg);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.instrument.annuity.AnnuityCouponFixedDefinition

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.