Package org.jquantlib.time

Examples of org.jquantlib.time.Period


    public EURLibor1Y() {
      this(new Handle<YieldTermStructure>());
    }
    public EURLibor1Y(final Handle<YieldTermStructure> h) {
        super(new Period(1, TimeUnit.Years), h);
    }
View Full Code Here


    }

    public Date fixingDate() {
        // if isInArrears_ fix at the end of period
        Date refDate = isInArrears_ ? accrualEndDate_ : accrualStartDate_;
        return index_.fixingCalendar().advance(refDate, new Period(-fixingDays_, TimeUnit.Days), BusinessDayConvention.Preceding);
    }
View Full Code Here

                gearing, spread, refPeriodStart, refPeriodEnd,
                dayCounter, false);
       
        this.fixingSchedule = index.fixingSchedule(index.fixingCalendar()
                                                    .advance(startDate,
                                                         new Period((index.fixingDays() + bmaCutoffDays)*-1,TimeUnit.Days),
                                                         BusinessDayConvention.Preceding)
                                               ,endDate);
        this.setPricer(new AverageBMACouponPricer());
    }
View Full Code Here

            final boolean includeFirstSwaplet,
            final Handle<YieldTermStructure> termStructure,
            final boolean calibrateVolatility){
        super(volatility, termStructure, calibrateVolatility);

        final Period indexTenor = index.tenor();
        final double fixedRate = 0.04; //dummy value
        Date startDate, maturity;
        if(includeFirstSwaplet){
            startDate = termStructure.currentLink().referenceDate();
            maturity = termStructure.currentLink().referenceDate().add(length);
        }
        else{
            startDate = termStructure.currentLink().referenceDate().add(indexTenor);
            maturity = termStructure.currentLink().referenceDate().add(length);
        }

        final IborIndex dummyIndex = new IborIndex("dummy",
                indexTenor,
                index.fixingDays(),
                index.currency(),
                index.fixingCalendar(),
                index.businessDayConvention(),
                index.endOfMonth(),
                termStructure.currentLink().dayCounter(),
                termStructure);

        final double [] nominals = {1,1.0};


        // TODO: code review :: please verify against QL/C++ code
        final Schedule fixedSchedule = new Schedule(
                startDate, maturity,
                new Period(fixedLegFrequency), index.fixingCalendar(),
                BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted,
                DateGeneration.Rule.Forward, false);

        //TODO: Code review :: incomplete code
        if (true)
View Full Code Here

    this.convAdj = convAdj;

    QL.require(new IMM().isIMMdate(immDate, false), NOT_A_VALID_IMM_DATE);

    earliestDate = immDate;
    latestDate = calendar.advance(immDate, new Period(lengthInMonths,
        TimeUnit.Months), convention, endOfMonth);
    yearFraction = dayCounter.yearFraction(earliestDate, latestDate);

    convAdj.addObserver(this);
  }   
View Full Code Here

    this.convAdj = new Handle<Quote>(new SimpleQuote(convAdj));

    QL.require(new IMM().isIMMdate(immDate, false), NOT_A_VALID_IMM_DATE);

    earliestDate = immDate;
    latestDate = calendar.advance(immDate, new Period(lengthInMonths,
        TimeUnit.Months), convention, endOfMonth);
    yearFraction = dayCounter.yearFraction(earliestDate, latestDate);
  }
View Full Code Here

        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

    public Euribor2W() {
      this(new Handle<YieldTermStructure>());
    }
    public Euribor2W(final Handle<YieldTermStructure> h) {
        super(new Period(2, TimeUnit.Weeks), h);
    }
View Full Code Here

        // Define exercise for Bermudan Options
        final int bermudanForwards = 4;
        final Date[] exerciseDates = new Date[bermudanForwards];
        for (int i = 1; i <= bermudanForwards; i++) {
            exerciseDates[i-1] = settlementDate.add(new Period(3 * i, TimeUnit.Months));
        }
        final Exercise bermudanExercise = new BermudanExercise(exerciseDates);

        // Define exercise for American Options
        final Exercise americanExercise = new AmericanExercise(settlementDate, maturity);
View Full Code Here

    public Euribor10M() {
      this(new Handle<YieldTermStructure>());
    }
    public Euribor10M(final Handle<YieldTermStructure> h) {
        super(new Period(10, TimeUnit.Months), h);
    }
View Full Code Here

TOP

Related Classes of org.jquantlib.time.Period

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.