Examples of adjust()


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

        if (unitedStatesCalendar.isBusinessDay(nextModified_PrecidingBusinessDay)) {
            System.out.println("NextModified_PrecidingBusinessDay = "+ nextModified_PrecidingBusinessDay+ " from today is a business date");
        }

        // Using UNADJUSTED as a business day convention
        final Date nextUnadjustedBusinessDay = unitedStatesCalendar.adjust(dateToday,BusinessDayConvention.Unadjusted);
        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
View Full Code Here

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

        final double redemption = 100.0;
        final double conversionRatio = redemption/underlying;

        final Calendar calendar = new Target();
        //adjust today to the next business day...
        final Date today = calendar.adjust(Date.todaysDate());
        QL.info("Today's date is adjusted by the default business day convention is: " + today.shortDate());
        // set the evaluation date to the adjusted today's date
        new Settings().setEvaluationDate(today);
        QL.info("Set the global evaluation date to the adjusted today's date: " + today.shortDate());
View Full Code Here

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

                new Entry( new Date(26, 1, 1973), new Date(26, 1, 1973) ),
            };

        final Calendar unitedStatesCalendar = new UnitedStates(UnitedStates.Market.NYSE);
        for (final Entry entry : entries) {
            final Date result = unitedStatesCalendar.adjust(entry.date, BusinessDayConvention.ModifiedFollowing);
            System.out.println("adjusted is " + result.isoDate() + "  ::  expected is " + entry.expected.isoDate());
            assertEquals(result, entry.expected);
        }
    }
View Full Code Here

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

                new Entry( new Date(26, 1, 1973), new Date(26, 1, 1973) ),
            };

        final Calendar unitedStatesCalendar = new UnitedStates(UnitedStates.Market.NYSE);
        for (final Entry entry : entries) {
            final Date result = unitedStatesCalendar.adjust(entry.date, BusinessDayConvention.ModifiedPreceding);
            System.out.println("adjusted is " + result.isoDate() + "  ::  expected is " + entry.expected.isoDate());
            assertEquals(result, entry.expected);
        }
    }
   
View Full Code Here

Examples of org.jquantlib.time.calendars.Target.adjust()

  public void testCachedZero() {

      QL.info("Testing zero-coupon bond prices against cached values...");

        final Calendar calendar = new Target();
        final Date today = calendar.adjust(Date.todaysDate());
        // final Date today = calendar.adjust(new Date(6,Month.June,2007));
      // final Date today = new Date(22,Month.November,2004);
      final Settings settings = new Settings();
      settings.setEvaluationDate(today);
View Full Code Here

Examples of org.jquantlib.time.calendars.Target.adjust()

  public void testCachedFixed() {

      QL.info("Testing fixed-coupon bond prices against cached values...");

        final Calendar calendar = new Target();
        final Date today = calendar.adjust(Date.todaysDate());
        // final Date today = calendar.adjust(new Date(6,Month.June,2007));
        // final Date today = new Date(22,Month.November,2004);
        final Settings settings = new Settings();
        settings.setEvaluationDate(today);
View Full Code Here

Examples of org.jquantlib.time.calendars.Target.adjust()

      QL.info("Testing Brazilian public bond prices against cached values...");

        final Calendar calendar = new Target();
        // final Date today = calendar.adjust(Date.todaysDate());
      final Date today = calendar.adjust(new Date(6,Month.June,2007));
      final Settings settings = new Settings();
      settings.setEvaluationDate(today);

        //final double faceAmount = 1000000.0;
        final double faceAmount = 1000.0;
View Full Code Here

Examples of org.jquantlib.time.calendars.Target.adjust()

        final Calendar calendar = new Target();

        // FIXME: outdated...
        Date settlementDate = new Date(18, Month.September, 2008);
        // must be a business day
        settlementDate = calendar.adjust(settlementDate);

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

        final Date todaysDate = calendar.advance(settlementDate, -fixingDays, TimeUnit.Days);
View Full Code Here

Examples of org.jquantlib.time.calendars.Target.adjust()

        final double redemption = 100.0;
        final double conversionRatio = redemption/underlying;

        final Calendar calendar = new Target();
        //adjust today to the next business day...
        final Date today = calendar.adjust(Date.todaysDate());
        QL.info("Today's date is adjusted by the default business day convention is: " + today.shortDate());
        // set the evaluation date to the adjusted today's date
        new Settings().setEvaluationDate(today);
        QL.info("Set the global evaluation date to the adjusted today's date: " + today.shortDate());
View Full Code Here

Examples of org.jquantlib.time.calendars.UnitedStates.adjust()

                new Entry( new Date(26, 1, 1973), new Date(26, 1, 1973) ),
            };

        final Calendar unitedStatesCalendar = new UnitedStates(UnitedStates.Market.NYSE);
        for (final Entry entry : entries) {
            final Date result = unitedStatesCalendar.adjust(entry.date, BusinessDayConvention.ModifiedFollowing);
            System.out.println("adjusted is " + result.isoDate() + "  ::  expected is " + entry.expected.isoDate());
            assertEquals(result, entry.expected);
        }
    }
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.