Examples of blackVariance()


Examples of org.jquantlib.termstructures.BlackVarianceTermStructure.blackVariance()

        forwardVolatility3 = varianceCurve.blackForwardVol(date27.clone(), date35.clone(), 60, true);
        System.out.println("Interpolated BlackForwardVolatility on BlackVarianceCurve = "+forwardVolatility3);


        //Calculating blackVariance using maturity as 12 days after today and strike as 20
        System.out.println("Interpolated BlackVariance on BlackVarianceCurve = "+varianceCurve.blackVariance(date12.clone(), 20));

        //Calculating blackForwardVariance between 12 days after today and 16 days after today with strike as 20
        System.out.println("Interpolated BlackForwardVariance on BlackVarianceCurve = "+varianceCurve.blackForwardVariance(date12.clone(), date16.clone(), 20, true));

        System.out.println("//===============================BlackVarianceSurface================================");
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVarianceTermStructure.blackVariance()

        forwardVolatility3 = varianceSurface.blackForwardVol(date27.clone(), date35.clone(), 50, true);
        System.out.println("Interpolated BlackForwardVolatility on BlackVarianceSurface = "+forwardVolatility3);


        //Calculating blackVariance using maturity as 12 days after today and strike as 20
        System.out.println("Interpolated BlackVariance on BlackVarianceSurface = "+varianceSurface.blackVariance(date12.clone(), 20));

        //Calculating blackForwardVariance between 12 days after today and 16 days after today with strike as 20
        System.out.println("Interpolated BlackForwardVariance on BlackVarianceSurface = "+varianceSurface.blackForwardVariance(date12.clone(), date16.clone(), 20, true));

        System.out.println("//================================ImpliedVolTermStructure=============================");
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVarianceTermStructure.blackVariance()

        }


        //Calculating blackVariance using maturity as 12 days after today and strike as 20
        final double variance = varianceCurve.blackVariance(date12.clone(), 20);
        final double impliedVariance = impliedVolTermStructure.blackVariance(date12.clone(), 20);
        if(variance == impliedVariance){
            System.out.println("Interpolated BlackVariance on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+varianceCurve.blackVariance(date12.clone(), 20));
        }

        //Calculating blackForwardVariance between 12 days after today and 16 days after today with strike as 20
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

        strike = underlyingLevel;
        y = Math.log(strike / forwardValue);
        dy = ((y != 0.0) ? y * 0.000001 : 0.000001);
        strikep = strike * Math.exp(dy);
        strikem = strike / Math.exp(dy);
        w = bTS.blackVariance(time,  strike, true);
        wp = bTS.blackVariance(time, strikep, true);
        wm = bTS.blackVariance(time, strikem, true);
        dwdy = (wp - wm) / (2.0 * dy);
        d2wdy2 = (wp - 2.0 * w + wm) / (dy * dy);

 
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

        y = Math.log(strike / forwardValue);
        dy = ((y != 0.0) ? y * 0.000001 : 0.000001);
        strikep = strike * Math.exp(dy);
        strikem = strike / Math.exp(dy);
        w = bTS.blackVariance(time,  strike, true);
        wp = bTS.blackVariance(time, strikep, true);
        wm = bTS.blackVariance(time, strikem, true);
        dwdy = (wp - wm) / (2.0 * dy);
        d2wdy2 = (wp - 2.0 * w + wm) / (dy * dy);

        // time derivative
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

        dy = ((y != 0.0) ? y * 0.000001 : 0.000001);
        strikep = strike * Math.exp(dy);
        strikem = strike / Math.exp(dy);
        w = bTS.blackVariance(time,  strike, true);
        wp = bTS.blackVariance(time, strikep, true);
        wm = bTS.blackVariance(time, strikem, true);
        dwdy = (wp - wm) / (2.0 * dy);
        d2wdy2 = (wp - 2.0 * w + wm) / (dy * dy);

        // time derivative
        /*@Time*/ final double t = time;
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

        /*@Time*/ final double t = time;
        /*@Time*/ double dt;
        double wpt, wmt, dwdt;
        if (t == 0.0) {
            dt = 0.0001;
            wpt = bTS.blackVariance(/*@Time*/ (t + dt), strike, true);
            QL.require(wpt >= w , "decreasing variance at strike"); // TODO: message
            dwdt = (wpt - w) / dt;
        } else {
            dt = Math.min(0.0001, t / 2.0);
            wpt = bTS.blackVariance(/*@Time*/ (t + dt), strike, true);
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

            wpt = bTS.blackVariance(/*@Time*/ (t + dt), strike, true);
            QL.require(wpt >= w , "decreasing variance at strike"); // TODO: message
            dwdt = (wpt - w) / dt;
        } else {
            dt = Math.min(0.0001, t / 2.0);
            wpt = bTS.blackVariance(/*@Time*/ (t + dt), strike, true);
            wmt = bTS.blackVariance(/*@Time*/ (t - dt), strike, true);
            QL.ensure(wpt >= w , "decreasing variance at strike"); // TODO: message
            QL.ensure(w >= wmt , "decreasing variance at strike"); // TODO: message
            dwdt = (wpt - wmt) / (2.0 * dt);
        }
View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

            QL.require(wpt >= w , "decreasing variance at strike"); // TODO: message
            dwdt = (wpt - w) / dt;
        } else {
            dt = Math.min(0.0001, t / 2.0);
            wpt = bTS.blackVariance(/*@Time*/ (t + dt), strike, true);
            wmt = bTS.blackVariance(/*@Time*/ (t - dt), strike, true);
            QL.ensure(wpt >= w , "decreasing variance at strike"); // TODO: message
            QL.ensure(w >= wmt , "decreasing variance at strike"); // TODO: message
            dwdt = (wpt - wmt) / (2.0 * dt);
        }

View Full Code Here

Examples of org.jquantlib.termstructures.BlackVolTermStructure.blackVariance()

        strike = underlyingLevel;
        y = Math.log(strike / forwardValue);
        dy = ((y != 0.0) ? y * 0.000001 : 0.000001);
        strikep = strike * Math.exp(dy);
        strikem = strike / Math.exp(dy);
        w = bTS.blackVariance(time,  strike, true);
        wp = bTS.blackVariance(time, strikep, true);
        wm = bTS.blackVariance(time, strikem, true);
        dwdy = (wp - wm) / (2.0 * dy);
        d2wdy2 = (wp - 2.0 * w + wm) / (dy * dy);

 
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.