Package com.opengamma.analytics.financial.instrument.payment

Examples of com.opengamma.analytics.financial.instrument.payment.CouponONCompoundedDefinition


   * @param isPayer The flag indicating if the annuity is paying (true) or receiving (false).
   * @return The swap.
   */
  public static SwapFixedCompoundedONCompoundedDefinition from(final ZonedDateTime settlementDate, final Period tenorAnnuity, final double notional,
      final GeneratorSwapFixedCompoundedONCompounded generator, final double fixedRate, final boolean isPayer) {
    final CouponONCompoundedDefinition onCompoundedCoupon = CouponONCompoundedDefinition.from(generator, settlementDate, tenorAnnuity, (isPayer ? 1.0 : -1.0) * notional);
    final double sign = isPayer ? -1.0 : 1.0;
    final double notionalSigned = sign * notional;
    return from(onCompoundedCoupon, notionalSigned, fixedRate, generator.getOvernightCalendar());
  }
View Full Code Here


   * @param isPayer The flag indicating if the annuity is paying (true) or receiving (false).
   * @return The swap.
   */
  public static SwapFixedCompoundedONCompoundedDefinition from(final ZonedDateTime settlementDate, final ZonedDateTime endFixingPeriodDate, final double notional,
      final GeneratorSwapFixedCompoundedONCompounded generator, final double fixedRate, final boolean isPayer) {
    final CouponONCompoundedDefinition onCompoundedCoupon = CouponONCompoundedDefinition.from(generator, settlementDate, endFixingPeriodDate, (isPayer ? 1.0 : -1.0) * notional);
    final double sign = isPayer ? -1.0 : 1.0;
    final double notionalSigned = sign * notional;
    return from(onCompoundedCoupon, notionalSigned, fixedRate, generator.getOvernightCalendar());
  }
View Full Code Here

        } else if (swap.getSecondLeg() instanceof AnnuityCouponONDefinition) {
          final AnnuityCouponONDefinition annuityCouponONDefinition = (AnnuityCouponONDefinition) swap.getSecondLeg();
          onIndex = annuityCouponONDefinition.getOvernightIndex();
          calendar = annuityCouponONDefinition.getCalendar();
        } else if (swap.getFirstLeg().getNthPayment(0) instanceof CouponONCompoundedDefinition) {
          final CouponONCompoundedDefinition couponONDefinition = (CouponONCompoundedDefinition) swap.getFirstLeg().getNthPayment(0);
          onIndex = couponONDefinition.getIndex();
          calendar = couponONDefinition.getCalendar();
        } else if (swap.getSecondLeg().getNthPayment(0) instanceof CouponONCompoundedDefinition) {
          final CouponONCompoundedDefinition couponONDefinition = (CouponONCompoundedDefinition) swap.getSecondLeg().getNthPayment(0);
          onIndex = couponONDefinition.getIndex();
          calendar = couponONDefinition.getCalendar();
        } else {
          throw new OpenGammaRuntimeException("Could not find overnight leg for " + underlyingSecurity);
        }
        final DayCount fixedLegDayCount = fixedLeg.getDayCount();
        final Frequency frequency = fixedLeg.getFrequency();
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.instrument.payment.CouponONCompoundedDefinition

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.