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()

        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

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

        final double y = rate.rate();
        final int N = rate.frequency().toInteger();

        for (int i = 0; i < cashFlows.size(); ++i) {
            if (!cashFlows.get(i).hasOccurred(date)) {
                final double t = dayCounter.yearFraction(date, cashFlows.get(i).date());
                final double c = cashFlows.get(i).amount();
                final double B = rate.discountFactor(t);

                P += c * B;
                switch (rate.compounding()) {
View Full Code Here

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

                                    value_m = option.NPV();
                                    vol.setValue(v);
                                    expected.put("vega", (value_p - value_m)/(2*dv) );

                                    // perturb date and get theta
                                    final /*@Time*/ double dT = dc.yearFraction(today.sub(1), today.add(1));
                                    new Settings().setEvaluationDate(today.sub(1));
                                    value_m = option.NPV();
                                    new Settings().setEvaluationDate(today.add(1));
                                    value_p = option.NPV();
                                    new Settings().setEvaluationDate(today);
View Full Code Here

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

        final double y = rate.rate();
        final int N = rate.frequency().toInteger();

        for (int i = 0; i < cashFlows.size(); ++i) {
            if (!cashFlows.get(i).hasOccurred(date)) {
                final double t = dayCounter.yearFraction(date, cashFlows.get(i).date());
                final double c = cashFlows.get(i).amount();
                final double B = rate.discountFactor(t);

                P += c * B;
                switch (rate.compounding()) {
View Full Code Here

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

            initialValues_.set(i, coupon.rate());
            accrualPeriod_.set(i, coupon.accrualPeriod());

            fixingDates_.set(i, coupon.fixingDate());
            fixingTimes_.set(i, dayCounter.yearFraction(startDate, coupon.fixingDate()));
            accrualStartTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualStartDate()));
            accrualEndTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualEndDate()));
        }
    }
View Full Code Here

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

            initialValues_.set(i, coupon.rate());
            accrualPeriod_.set(i, coupon.accrualPeriod());

            fixingDates_.set(i, coupon.fixingDate());
            fixingTimes_.set(i, dayCounter.yearFraction(startDate, coupon.fixingDate()));
            accrualStartTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualStartDate()));
            accrualEndTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualEndDate()));
        }
    }

View Full Code Here

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

            accrualPeriod_.set(i, coupon.accrualPeriod());

            fixingDates_.set(i, coupon.fixingDate());
            fixingTimes_.set(i, dayCounter.yearFraction(startDate, coupon.fixingDate()));
            accrualStartTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualStartDate()));
            accrualEndTimes_.set(i, dayCounter.yearFraction(settlement, coupon.accrualEndDate()));
        }
    }


    //
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);
        try {
            greeks.theta = black.theta(spot, t);
            moreGreeks.thetaPerDay = black.thetaPerDay(spot, t);
        } catch (final Exception e) {
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.