Package org.jquantlib.time.calendars

Examples of org.jquantlib.time.calendars.Target


    public void testImpliedObs() {
        QL.info("Testing observability of implied term structure...");

        final Date today = new Settings().evaluationDate();
        final Date newToday = today.add(Period.ONE_YEAR_FORWARD.mul(3));
        final Date newSettlement = new Target().advance(newToday, settlementDays, TimeUnit.Days);

        //FIXME:: Fix RelinkableHandle. The initialization of "h" should be:
        //
        //        final RelinkableHandle<YieldTermStructure> h = new RelinkableHandle<YieldTermStructure>() { /* anonymous */ };
        //
View Full Code Here


    public Euribor365(final Period tenor, final Handle<YieldTermStructure> h) {
        super("Euribor365", tenor,
                2, // settlement days
                new EURCurrency(),
                new Target(),
                euriborConvention(tenor),
                euriborEOM(tenor),
                new Actual365Fixed(),
                h);
        QL.require(this.tenor().units() != TimeUnit.Days , "for daily tenors dedicated DailyTenor constructor must be used"); // QA:[RG]::verified // TODO: message
View Full Code Here

    }


    @Test
    public void testSchedule() {
        final Calendar calendar = new Target();
        final Period maturity = new Period(30, TimeUnit.Years);
        final Date maturityDate = startDate.add(maturity);
        final Period accPeriodTenor = new Period(6, TimeUnit.Months);
        final BusinessDayConvention modFollow = BusinessDayConvention.ModifiedFollowing;
        final DateGeneration.Rule dateRule = DateGeneration.Rule.Backward;

        final Schedule firstConstrSchedule = new Schedule(
                startDate, maturityDate, accPeriodTenor,
                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

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

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

    public UsdLiborSwapIsdaFixPm(final Period tenor, final Handle<YieldTermStructure> h) {
        super( "UsdLiborSwapIsdaFixPm",
                tenor,
                2, // settlement days
                new USDCurrency(),
                new Target(),
                new Period(6,TimeUnit.Months),
                BusinessDayConvention.ModifiedFollowing,
                new Thirty360(Thirty360.Convention.BondBasis),
                new USDLibor(new Period(3,TimeUnit.Months), h)
                   
View Full Code Here

        final StopClock clock = new StopClock();
        clock.startClock();

        // set up dates
        final Calendar calendar = new Target();
        final Date todaysDate = new Date(15, Month.May, 1998);
        final Date settlementDate = new Date(17, Month.May, 1998);
        new Settings().setEvaluationDate(todaysDate);

        // our options
View Full Code Here

    public GbpLiborSwapIsdaFix(final Period tenor, final Handle<YieldTermStructure> h) {
        super( "GbpLiborSwapIsdaFix",
                tenor,
                2, // settlement days
                new GBPCurrency(),
                new Target(),
                tenor.gt(new Period(1,TimeUnit.Years)) ? new Period(6,TimeUnit.Months):
                                     new Period(1,TimeUnit.Years),
                BusinessDayConvention.ModifiedFollowing,
                new Actual365Fixed(),
                tenor.gt(new Period(1,TimeUnit.Years)) ? new GBPLibor(new Period(6,TimeUnit.Months), h):
View Full Code Here

    public UsdLiborSwapIsdaFixAm(final Period tenor, final Handle<YieldTermStructure> h) {
        super( "UsdLiborSwapIsdaFixAm",
                tenor,
                2, // settlement days
                new USDCurrency(),
                new Target(),
                new Period(6,TimeUnit.Months),
                BusinessDayConvention.ModifiedFollowing,
                new Thirty360(Thirty360.Convention.BondBasis),
                new USDLibor(new Period(3,TimeUnit.Months), h)
                   
View Full Code Here

        QL.info("Started calculation at: " + clock.getElapsedTime());
        /*********************
         *** MARKET DATA ***
         *********************/

        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);
        new Settings().setEvaluationDate(todaysDate);

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

View Full Code Here

TOP

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

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.