Package org.jquantlib.time.calendars

Examples of org.jquantlib.time.calendars.Target$Impl


*/
public class TestCalendarReferences {

    @Test
    public void testCalendarAdvance() {
        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);

        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


        assertNotSame(today, nextDate);
    }

    @Test
    public void testCalendarAdjust(){
        final Calendar calendar = new Target();
        final Date today = new Date(20, Month.June, 2008);

        // check advance should return same reference
        final Date nextDate = calendar.adjust(today, BusinessDayConvention.Following);
//        assertSame(today, nextDate);
        assertEquals(today, nextDate);
    }
View Full Code Here

  @Test
  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

  @Test
  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

  @Test
  public void testBrazilianCached() {

      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

        // cleanup
        SavedSettings backup = new SavedSettings();

        // setup
        public CommonVars() {
            calendar = new Target();
            today = calendar.adjust(Date.todaysDate());
            new Settings().setEvaluationDate(today);
            faceAmount = 1000000.0;
        }
View Full Code Here

    // cleanup
    SavedSettings backup = new SavedSettings();

    // setup
    CommonVars() {
      calendar = new Target();

      today = calendar.adjust(Date.todaysDate());
      new Settings().setEvaluationDate(today);

      dayCounter = new Actual360();
View Full Code Here

    private final boolean quiet = false;


    public FDDividendOptionTest() {
        this.calendar = new Target();
        this.today = new Date(15, Month.May, 1998);
        this.settlementDate = new Date(17, Month.May, 1998);

        this.type = Option.Type.Put;
        this.strike = 40.0;
View Full Code Here

    private final boolean quiet = false;


    public CRRDividendOptionTest() {
        this.calendar = new Target();
        this.today = new Date(15, Month.May, 1998);
        this.settlementDate = new Date(17, Month.May, 1998);

        this.type = Option.Type.Put;
        this.strike = 40.0;
View Full Code Here

   * @param refDate
   * @param cal
   * @param dc
   */
  protected ForwardRateStructure(final Date refDate, final DayCounter dc) {
    this(refDate, new Target(), dc); // FIXME: code review : default calendar
        QL.validateExperimentalMode();
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.time.calendars.Target$Impl

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.