Package org.jquantlib.termstructures.volatilities

Examples of org.jquantlib.termstructures.volatilities.LocalVolCurve


            // ok, so it's not constant. Maybe it's strike-independent?
            if (BlackVarianceCurve.class.isAssignableFrom(klass)) {
                final Handle<BlackVarianceCurve> volCurve = new Handle<BlackVarianceCurve>(
                        (BlackVarianceCurve) blackVolatility().currentLink());
                localVolatility.linkTo(new LocalVolCurve(volCurve));
                updated = true;
                return localVolatility;
            }

            // ok, so it's strike-dependent. Never mind.
View Full Code Here


        }

        System.out.println("//================================LocalVolCurve==========================================");

        //LocalVolatility curve wraps BlackVarianceCurve and uses it to calculate the interpolated local volatility
        final LocalVolTermStructure localVolatilityCurve = new LocalVolCurve(new RelinkableHandle<BlackVarianceCurve>((BlackVarianceCurve)varianceCurve));

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

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

        //Calculating blackVolatility using maturity as 32 days after today and strike as 40
        volatility3 = localVolatilityCurve.localVol(date32.clone(), 40,true);
        System.out.println("Interpolated BlackVolatility on LocalVolCurve = "+volatility3);


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

TOP

Related Classes of org.jquantlib.termstructures.volatilities.LocalVolCurve

Copyright © 2018 www.massapicom. 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.