Package org.jquantlib.termstructures

Examples of org.jquantlib.termstructures.BlackVarianceTermStructure.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


        //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

        //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);


        //Calculating blackForwardVolatility between 12 days after today and 16 days after today with strike as 20
        forwardVolatility1 = varianceCurve.blackForwardVol(date12.clone(), date16.clone(), 20, true);
View Full Code Here

        ((BlackVarianceSurface)varianceSurface).setInterpolation(null);

        //As the surface has been set up to do interpolations so let's start calculating the volatilities for strikes
        //and maturities lying between the points as mentioned by strikesAxis and dateAxis.
        //Calculating blackVolatility using maturity as 12 days after today and strike as 18
        volatility1 = varianceSurface.blackVol(date12.clone(), 18);
        System.out.println("Interpolated BlackVolatility on BlackVarianceSurface = "+volatility1);

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

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

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

        //Calculating blackVolatility using maturity as 32 days after today and strike as 45
        volatility3 = varianceSurface.blackVol(date32.clone(), 45);
        System.out.println("Interpolated BlackVolatility on BlackVarianceSurface = "+volatility3);
View Full Code Here

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

        //Calculating blackVolatility using maturity as 32 days after today and strike as 45
        volatility3 = varianceSurface.blackVol(date32.clone(), 45);
        System.out.println("Interpolated BlackVolatility on BlackVarianceSurface = "+volatility3);


        //Calculating blackForwardVolatility between 12 days after today and 16 days after today with strike as 20
        forwardVolatility1 = varianceSurface.blackForwardVol(date12.clone(), date16.clone(), 20, true);
View Full Code Here

        final RelinkableHandle<BlackVolTermStructure> varianceCurveHandle = new RelinkableHandle<BlackVolTermStructure>(varianceCurve);
        final BlackVarianceTermStructure impliedVolTermStructure = new ImpliedVolTermStructure(varianceCurveHandle, today);

        //Calculating blackVolatility using maturity as 12 days after today and strike as 20
        volatility1 = varianceCurve.blackVol(date12.clone(), 20);
        final double impliedVolatility1 = impliedVolTermStructure.blackVol(date12.clone(), 20);

        if(volatility1 == impliedVolatility1){
            System.out.println("Interpolated BlackVolatility on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+volatility1);
        }
View Full Code Here

            System.out.println("Interpolated BlackVolatility on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+volatility1);
        }

        //Calculating blackVolatility using maturity as 22 days after today and strike as 30
        volatility2 = varianceCurve.blackVol(date22.clone(), 30);
        final double impliedVolatility2 = impliedVolTermStructure.blackVol(date22.clone(), 30);
        if(volatility2 == impliedVolatility2){
            System.out.println("Interpolated BlackVolatility on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+volatility2);
        }

        //Calculating blackVolatility using maturity as 32 days after today and strike as 40
View Full Code Here

            System.out.println("Interpolated BlackVolatility on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+volatility2);
        }

        //Calculating blackVolatility using maturity as 32 days after today and strike as 40
        volatility3 = varianceCurve.blackVol(date32.clone(), 40);
        final double impliedVolatility3 = impliedVolTermStructure.blackVol(date32.clone(), 40);
        if(volatility3 == impliedVolatility3){
            System.out.println("Interpolated BlackVolatility on BlackVarianceCurve is same for varianceCurve and ImpliedVolTermStructure derived on it and = "+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.