Examples of yearFraction()


Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

            greeks.rho = black.rho(t);

            t = divdc.yearFraction(process.dividendYield().currentLink().referenceDate(), a.exercise.lastDate());
            greeks.dividendRho = black.dividendRho(t);

            t = voldc.yearFraction(process.blackVolatility().currentLink().referenceDate(), a.exercise.lastDate());
            greeks.vega            = black.vega(t);
            greeks.theta           = black.theta(spot, t);
            moreGreeks.thetaPerDay = black.thetaPerDay(spot, t);

            moreGreeks.strikeSensitivity  = black.strikeSensitivity();
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

        final double /* @Real */variance = process.blackVolatility().currentLink().blackVariance(A.exercise.lastDate(), 1.0);

        final DayCounter voldc = process.blackVolatility().currentLink().dayCounter();
        final Calendar volcal = process.blackVolatility().currentLink().calendar();
        final Date volRefDate = process.blackVolatility().currentLink().referenceDate();
        final double /* @Time */t = voldc.yearFraction(volRefDate, A.exercise.lastDate());
        final double /* @Rate */riskFreeRate = -Math.log(process.riskFreeRate().currentLink().discount(A.exercise.lastDate())) / t;
        final Date rateRefDate = process.riskFreeRate().currentLink().referenceDate();

        final PoissonDistribution p = new PoissonDistribution(lambda * t);

 
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

       final DayCounter dayCounter = this.process.riskFreeRate().currentLink().dayCounter();
       final Date bondSettlement = this.arguments.settlementDate;

       stoppingTimes = new ArrayList<Double>(this.arguments.exercise.dates().size());
       for (int i=0; i<this.arguments.exercise.dates().size(); ++i)
           stoppingTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.exercise.date(i)));

       callabilityTimes = new ArrayList<Double>(this.arguments.callabilityDates.size());
       for (int i=0; i<this.arguments.callabilityDates.size(); ++i)
           callabilityTimes.add(dayCounter.yearFraction(bondSettlement,
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

           stoppingTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.exercise.date(i)));

       callabilityTimes = new ArrayList<Double>(this.arguments.callabilityDates.size());
       for (int i=0; i<this.arguments.callabilityDates.size(); ++i)
           callabilityTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.callabilityDates.get(i)));

       couponTimes = new ArrayList<Double>(this.arguments.couponDates.size());
       for (int i=0; i<this.arguments.couponDates.size(); ++i)
           couponTimes.add(dayCounter.yearFraction(bondSettlement,
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

           callabilityTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.callabilityDates.get(i)));

       couponTimes = new ArrayList<Double>(this.arguments.couponDates.size());
       for (int i=0; i<this.arguments.couponDates.size(); ++i)
           couponTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.couponDates.get(i)));

       dividendTimes = new ArrayList<Double>(this.arguments.dividendDates.size());
       for (int i=0; i<this.arguments.dividendDates.size(); ++i)
           dividendTimes.add(dayCounter.yearFraction(bondSettlement,
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

           couponTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.couponDates.get(i)));

       dividendTimes = new ArrayList<Double>(this.arguments.dividendDates.size());
       for (int i=0; i<this.arguments.dividendDates.size(); ++i)
           dividendTimes.add(dayCounter.yearFraction(bondSettlement,
                                       this.arguments.dividendDates.get(i)));

       if (!grid.empty()) {
           // adjust times to grid
           for (int i=0; i<stoppingTimes.size(); i++)
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

        for (final Date d = today.add(new Period(6, TimeUnit.Months)); d.lt(exerciseDate); d.addAssign(new Period(6, TimeUnit.Months))) {
            dividends.add(new FixedDividend(1.0, d));
        }

        final DayCounter dayCounter = new Actual365Fixed();
        /*@Time*/ final double maturity = dayCounter.yearFraction(settlementDate,exerciseDate);

        System.out.println("option type = "+type);
        System.out.println("Time to maturity = "+maturity);
        System.out.println("Underlying price = "+underlying);
        System.out.println("Risk-free interest rate = "+riskFreeRate);
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

        // TODO: consider double[] instead
        final List<Double> fixingTimes = new ArrayList<Double>();
        /*@Size*/ int i;
        for (i=0; i<a.fixingDates.size(); i++) {
            if (a.fixingDates.get(i).ge(referenceDate)) {
                /*@Time*/ final double t = voldc.yearFraction(referenceDate,
                        a.fixingDates.get(i));
                fixingTimes.add(Double.valueOf(t));
            }
        }

View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

            greeks.rho = black.rho(t);

            t = divdc.yearFraction(process.dividendYield().currentLink().referenceDate(), a.exercise.lastDate());
            greeks.dividendRho = black.dividendRho(t);

            t = voldc.yearFraction(process.blackVolatility().currentLink().referenceDate(), a.exercise.lastDate());
            greeks.vega            = black.vega(t);
            greeks.theta           = black.theta(spot, t);
            moreGreeks.thetaPerDay = black.thetaPerDay(spot, t);

            moreGreeks.strikeSensitivity  = black.strikeSensitivity();
View Full Code Here

Examples of org.jquantlib.daycounters.DayCounter.yearFraction()

        greeks.delta = black.delta(spot);
        greeks.gamma = black.gamma(spot);

        final DayCounter rfdc  = process.riskFreeRate().currentLink().dayCounter();
        final DayCounter voldc = process.blackVolatility().currentLink().dayCounter();
        /*@Time*/ double t = voldc.yearFraction(process.blackVolatility().currentLink().referenceDate(), a.exercise.lastDate());
        greeks.vega = black.vega(t);

        double delta_theta = 0.0, delta_rho = 0.0;
        for (int i = 0; i < a.cashFlow.size(); i++) {
            final CashFlow cashflow = a.cashFlow.get(i);
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.