Package org.jquantlib.termstructures.volatilities

Examples of org.jquantlib.termstructures.volatilities.LocalConstantVol.localVol()


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


        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)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date20.clone(), 30,true));
View Full Code Here

        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

            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)){
            System.out.println("BlackVolatility and LocalVolatility are same and are = "+localConstantVolatility.localVol(date30.clone(), 40,true));
View Full Code Here

        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

            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==========================================");

        //LocalVolatility curve wraps BlackVarianceCurve and uses it to calculate the interpolated local volatility
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.