Examples of adjust()


Examples of org.jquantlib.time.Calendar.adjust()

        }
        // regular periods
        for (int i = 2; i < schedule_.size() - 1; ++i) {
            start = end;
            end = schedule_.date(i);
            paymentDate = calendar.adjust(end, paymentAdjustment_);
            if ((i - 1) < couponRates_.length) {
                rate = couponRates_[i - 1];
            } else {
                rate = couponRates_[couponRates_.length - 1];
            }
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

        if (schedule_.size() > 2) {
            // last period might be short or long
            final int N = schedule_.size();
            start = end;
            end = schedule_.date(N - 1);
            paymentDate = calendar.adjust(end, paymentAdjustment_);
            if ((N - 2) < couponRates_.length) {
                rate = couponRates_[N - 2];
            } else {
                rate = couponRates_[couponRates_.length - 1];
            }
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

            }
            if (schedule_.isRegular(N - 1)) {
                leg.add(new FixedRateCoupon(nominal, paymentDate, rate, paymentDayCounter_, start, end, start, end));
            } else {
                Date ref = start.add(schedule_.tenor());
                ref = calendar.adjust(ref, schedule_.businessDayConvention());
                leg.add(new FixedRateCoupon(nominal, paymentDate, rate, paymentDayCounter_, start, end, start, ref));
            }
        }
        return leg;
    }
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

        for (int i=0; i<n; ++i) {
            refStart = start = schedule.date(i);
            refEnd   =   end = schedule.date(i+1);
            final Date paymentDate =
                isZero ? lastPaymentDate : calendar.adjust(end, paymentAdj);
            if (i==0   && !schedule.isRegular(i+1)) {
                final BusinessDayConvention bdc = schedule.businessDayConvention();
                refStart = calendar.adjust(end.sub(schedule.tenor()), bdc);
            }
            if (i==n-1 && !schedule.isRegular(i+1)) {
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

            refEnd   =   end = schedule.date(i+1);
            final Date paymentDate =
                isZero ? lastPaymentDate : calendar.adjust(end, paymentAdj);
            if (i==0   && !schedule.isRegular(i+1)) {
                final BusinessDayConvention bdc = schedule.businessDayConvention();
                refStart = calendar.adjust(end.sub(schedule.tenor()), bdc);
            }
            if (i==n-1 && !schedule.isRegular(i+1)) {
                final BusinessDayConvention bdc = schedule.businessDayConvention();
                refEnd = calendar.adjust(start.add(schedule.tenor()), bdc);
            }
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

                final BusinessDayConvention bdc = schedule.businessDayConvention();
                refStart = calendar.adjust(end.sub(schedule.tenor()), bdc);
            }
            if (i==n-1 && !schedule.isRegular(i+1)) {
                final BusinessDayConvention bdc = schedule.businessDayConvention();
                refEnd = calendar.adjust(start.add(schedule.tenor()), bdc);
            }
            if (get(gearings, i, 1.0) == 0.0) { // fixed coupon
                add(new FixedRateCoupon(get(nominals, i, 1.0),
                                    paymentDate,
                                    effectiveFixedRate(spreads,caps,floors,i),
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

          refStart = schedule.date(i);
          start = schedule.date(i);
         
          refEnd = schedule.date(i+1);
          end = schedule.date(i+1);
          paymentDate = calendar.adjust(end, paymentAdjustment);
         
          if (i == 0 && !schedule.isRegular(i+1)) {
            refStart = calendar.adjust(end.sub(schedule.tenor()),
                                   paymentAdjustment);
          }
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

          refEnd = schedule.date(i+1);
          end = schedule.date(i+1);
          paymentDate = calendar.adjust(end, paymentAdjustment);
         
          if (i == 0 && !schedule.isRegular(i+1)) {
            refStart = calendar.adjust(end.sub(schedule.tenor()),
                                   paymentAdjustment);
          }

          if (i == n-1 && !schedule.isRegular(i+1))
            refEnd = calendar.adjust(start.add(schedule.tenor()),
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

            refStart = calendar.adjust(end.sub(schedule.tenor()),
                                   paymentAdjustment);
          }

          if (i == n-1 && !schedule.isRegular(i+1))
            refEnd = calendar.adjust(start.add(schedule.tenor()),
                                        paymentAdjustment);
         
          AverageBMACoupon coupon = new AverageBMACoupon(paymentDate,
                                  notionals.get(i) != 0.0 ? notionals.get(i):notionals.last(),
                                  start,
View Full Code Here

Examples of org.jquantlib.time.Calendar.adjust()

        // the following is not always correct
        final Calendar calendar = schedule.calendar();

        Date refStart, start, refEnd, end;
        final Date lastPaymentDate = calendar.adjust(schedule.date(n), paymentAdj);

        for (int i=0; i<n; ++i) {
            refStart = start = schedule.date(i);
            refEnd   =   end = schedule.date(i+1);
            final Date paymentDate =
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.