Package org.jquantlib.time

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


                calendar, modFollow, modFollow,
                dateRule, false, null, null);

        final List<Date> dates = new ArrayList<Date>();
        dates.add(startDate);
        dates.add(calendar.advance(startDate, new Period(10, TimeUnit.Weeks),modFollow));

        final Schedule secondConstrSchedule = new Schedule(dates, calendar, modFollow);

        testDateAfter(firstConstrSchedule);
        testDateAfter(secondConstrSchedule);
View Full Code Here


        final Calendar calendar = new Target();
        final Date today = new Date(20, Month.June, 2008);
        final Period thirtyYears = new Period(30, TimeUnit.Years);

        // check advance should return different reference
        Date nextDate = calendar.advance(today, new Period(1,TimeUnit.Days));
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, 10, TimeUnit.Days);
        assertNotSame(today, nextDate);
View Full Code Here

        // check advance should return different reference
        Date nextDate = calendar.advance(today, new Period(1,TimeUnit.Days));
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, 10, TimeUnit.Days);
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following);
        assertNotSame(today, nextDate);
View Full Code Here

        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, 10, TimeUnit.Days);
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following);
        assertNotSame(today, nextDate);


        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following, true);
        assertNotSame(today, nextDate);
View Full Code Here

        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following);
        assertNotSame(today, nextDate);


        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following, true);
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, 10, TimeUnit.Days, BusinessDayConvention.Following, true);
        assertNotSame(today, nextDate);
    }
View Full Code Here


        nextDate = calendar.advance(today, thirtyYears, BusinessDayConvention.Following, true);
        assertNotSame(today, nextDate);

        nextDate = calendar.advance(today, 10, TimeUnit.Days, BusinessDayConvention.Following, true);
        assertNotSame(today, nextDate);
    }

    @Test
    public void testCalendarAdjust(){
View Full Code Here

    for (int i = 0; i < (issueMonths).length; i++) {
      for (int j = 0; j < (lengths).length; j++) {
        for (int k = 0; k < (coupons).length; k++) {
          for (int l = 0; l < (frequencies).length; l++) {
            for (int n = 0; n < (compounding).length; n++) {
              final Date dated = calendar.advance(today, issueMonths[i], TimeUnit.Months);
              final Date issue = dated;
              final Date maturity = calendar.advance(issue, lengths[j], TimeUnit.Years);

              final Schedule sch = new Schedule(
                      dated,
View Full Code Here

        for (int k = 0; k < (coupons).length; k++) {
          for (int l = 0; l < (frequencies).length; l++) {
            for (int n = 0; n < (compounding).length; n++) {
              final Date dated = calendar.advance(today, issueMonths[i], TimeUnit.Months);
              final Date issue = dated;
              final Date maturity = calendar.advance(issue, lengths[j], TimeUnit.Years);

              final Schedule sch = new Schedule(
                      dated,
                  maturity,
                  new Period(frequencies[l]),
View Full Code Here

      for (final double coupon : coupons) {
        for (final Frequency frequency : frequencies) {

          final Date dated = today;
          final Date issue = dated;
          final Date maturity = calendar.advance(issue, length, TimeUnit.Years);

          final SimpleQuote rate = new SimpleQuote(0.0);
          final Handle<YieldTermStructure> discountCurve = new Handle<YieldTermStructure>(Utilities.flatRate(today, rate, bondDayCount));

          final Schedule sch = new Schedule(
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.