Package org.jquantlib.time

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


    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

        QL.require(new IMM().isIMMdate(immDate, false) , "not a valid IMM date"); // QA:[RG]::verified // TODO: message
        convAdj = new Handle<Quote>(new SimpleQuote(conv));
        earliestDate = immDate;
        final Calendar cal = i.fixingCalendar();
        latestDate = cal.advance(immDate, i.tenor(), i.businessDayConvention());
        yearFraction = i.dayCounter().yearFraction(earliestDate, latestDate);
    }

    @Override
    public double impliedQuote() {
View Full Code Here

                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

       
        QL.require(new IMM().isIMMdate(immDate, false) , NOT_A_VALID_IMM_DATE);
       
        earliestDate = immDate;
        final Calendar cal = i.fixingCalendar();
        latestDate = cal.advance(immDate, i.tenor(), i.businessDayConvention());
        yearFraction = i.dayCounter().yearFraction(earliestDate, latestDate);
    }


    /**
 
View Full Code Here

        settlementDate = calendar.adjust(settlementDate);

        final int fixingDays = 3;
        final int settlementDays = 3;

        final Date todaysDate = calendar.advance(settlementDate, -fixingDays, TimeUnit.Days);
        new Settings().setEvaluationDate(todaysDate);

        QL.info("Evaluation date: " + todaysDate.weekday() + ", " + todaysDate);
        QL.info("Settlement date: " + settlementDate.weekday() + ", " + settlementDate);
View Full Code Here

        final Date todaysDate = new Date(23, Month.May, 2006);
        new Settings().setEvaluationDate(todaysDate);

        final Calendar calendar = euribor3m.currentLink().fixingCalendar();
        final int fixingDays = euribor3m.currentLink().fixingDays();
        final Date settlementDate = calendar.advance(todaysDate, fixingDays, TimeUnit.Months );

        System.out.println("Today: "+ todaysDate.weekday() + "," + todaysDate);

        System.out.println("Settlement date: " + settlementDate.weekday() + "," + settlementDate);
View Full Code Here

        if (unitedStatesCalendar.isHoliday(firstHolidayDate)) {
            System.out.println("FirstHolidayDate = " + firstHolidayDate+ " is a holiday date");
        }

        // Advance the first holiday date using calendars's advance(date) API and get the nexBusinessDay
        final Date nextBusinessDay = unitedStatesCalendar.advance(firstHolidayDate, new Period(1, TimeUnit.Days));
        if (unitedStatesCalendar.isBusinessDay(nextBusinessDay)) {
            System.out.println("NextBusinessDayFromFirstHolidayFromToday = "+ nextBusinessDay + " is a business date");
        }

        // Adjust todaysDate using different businessDayConventions
View Full Code Here

        if (unitedStatesCalendar.isBusinessDay(nextModified_PrecidingBusinessDay)) {
            System.out.println("NextUnadjustedBusinessDay = "+ nextUnadjustedBusinessDay+ " from today is a business date and is same as today");
        }

        // Advance the current date using calendars's advance(date,n,unit) where n = 10 and unit=DAYS
        Date advancedDate = unitedStatesCalendar.advance(dateToday, 10,TimeUnit.Days);
        System.out.println("Next business date when today's date is advanced by 10 days = "+ advancedDate);

        // Advance the current date using calendars's advance(date,n,unit) where n = 10 and unit=WEEKS
        advancedDate = unitedStatesCalendar.advance(dateToday, 10, TimeUnit.Weeks);
        System.out.println("Next business date when today's date is advanced by 10 weeks = "+ advancedDate);
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.