Examples of blackVol()


Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //Calculating blackVolatility using maturity as 10 days after today and strike as 20
        Double volatility1 = constantVolatility.blackVol(date10.clone(), 20);
        System.out.println("BlackVolatility = "+volatility1);

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        Double volatility2 = constantVolatility.blackVol(date20.clone(), 30);
        System.out.println("BlackVolatility = "+volatility2);

        //Calculating blackVolatility using maturity as 30 days after today and strike as 40
        Double volatility3 = constantVolatility.blackVol(date30.clone(), 40);
        System.out.println("BlackVolatility = "+volatility3);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        Double volatility2 = constantVolatility.blackVol(date20.clone(), 30);
        System.out.println("BlackVolatility = "+volatility2);

        //Calculating blackVolatility using maturity as 30 days after today and strike as 40
        Double volatility3 = constantVolatility.blackVol(date30.clone(), 40);
        System.out.println("BlackVolatility = "+volatility3);

        //The volatilities calculated above are same as it's constant volatility termstructure
        if(volatility1.equals(volatility2) && volatility2.equals(volatility3)){
            System.out.println("All the volatilities calculated above are same and = "+volatility1);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //and see the change getting reflected to all the calculations done above.
        volatilityQuote.setValue(0.04) ;
        constantVolatility = new BlackConstantVol(2,new UnitedStates(Market.NYSE),handleToVolatilityQuote, new Actual365Fixed());

        //Calculating blackVolatility using maturity as 10 days after today and strike as 20
        volatility1 = constantVolatility.blackVol(date10.clone(), 20);
        System.out.println("BlackVolatility = "+volatility1);

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        volatility2 = constantVolatility.blackVol(date20.clone(), 30);
        System.out.println("BlackVolatility = "+volatility2);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //Calculating blackVolatility using maturity as 10 days after today and strike as 20
        volatility1 = constantVolatility.blackVol(date10.clone(), 20);
        System.out.println("BlackVolatility = "+volatility1);

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        volatility2 = constantVolatility.blackVol(date20.clone(), 30);
        System.out.println("BlackVolatility = "+volatility2);

        volatility3 = constantVolatility.blackVol(date30.clone(), 40);
        System.out.println("BlackVolatility = "+volatility3);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        volatility2 = constantVolatility.blackVol(date20.clone(), 30);
        System.out.println("BlackVolatility = "+volatility2);

        volatility3 = constantVolatility.blackVol(date30.clone(), 40);
        System.out.println("BlackVolatility = "+volatility3);

        //The volatilities calculated above are same as it's constant volatility termstructure
        if(volatility1.equals(volatility2) && volatility2.equals(volatility3)){
            System.out.println("All the volatilities calculated above are same and = "+volatility1);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        //Let's set the quoteValue = 0.05 and use the constantVolatility a BlackConstantVol
        volatilityQuote.setValue(0.05);
        final LocalVolTermStructure localConstantVolatility = new LocalConstantVol(2,new UnitedStates(Market.NYSE),handleToVolatilityQuote, new Actual365Fixed());

        //Calculating blackVolatility using maturity as 10 days after today and strike as 20
        if(constantVolatility.blackVol(date10.clone(), 20) == localConstantVolatility.localVol(date10.clone(), 20,true)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date10.clone(), 20,true));
        }

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        if(constantVolatility.blackVol(date20.clone(), 30) == localConstantVolatility.localVol(date20.clone(), 30,true)){
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        if(constantVolatility.blackVol(date10.clone(), 20) == localConstantVolatility.localVol(date10.clone(), 20,true)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date10.clone(), 20,true));
        }

        //Calculating blackVolatility using maturity as 20 days after today and strike as 30
        if(constantVolatility.blackVol(date20.clone(), 30) == localConstantVolatility.localVol(date20.clone(), 30,true)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date20.clone(), 30,true));
        }

        //Calculating blackVolatility using maturity as 30 days after today and strike as 40
        if(constantVolatility.blackVol(date30.clone(), 40) == localConstantVolatility.localVol(date30.clone(), 40,true)){
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol.blackVol()

        if(constantVolatility.blackVol(date20.clone(), 30) == localConstantVolatility.localVol(date20.clone(), 30,true)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date20.clone(), 30,true));
        }

        //Calculating blackVolatility using maturity as 30 days after today and strike as 40
        if(constantVolatility.blackVol(date30.clone(), 40) == localConstantVolatility.localVol(date30.clone(), 40,true)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date30.clone(), 40,true));
        }

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

Examples of org.jquantlib.termstructures.volatilities.BlackVarianceCurve.blackVol()

        //Following is the curve
        final BlackVarianceTermStructure varianceCurve = new BlackVarianceCurve(today,dates,volatilities, new Actual365Fixed(), false);
        ((BlackVarianceCurve)varianceCurve).setInterpolation();

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

        //Calculating blackVolatility using maturity as 22 days after today and strike as 30
        volatility2 = varianceCurve.blackVol(date22.clone(), 30);
        System.out.println("Interpolated BlackVolatility on BlackVarianceCurve = "+volatility2);
View Full Code Here

Examples of org.jquantlib.termstructures.volatilities.BlackVarianceCurve.blackVol()

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

        //Calculating blackVolatility using maturity as 22 days after today and strike as 30
        volatility2 = varianceCurve.blackVol(date22.clone(), 30);
        System.out.println("Interpolated BlackVolatility on BlackVarianceCurve = "+volatility2);

        //Calculating blackVolatility using maturity as 32 days after today and strike as 40
        volatility3 = varianceCurve.blackVol(date32.clone(), 40);
        System.out.println("Interpolated BlackVolatility on BlackVarianceCurve = "+volatility3);
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.