Package org.jquantlib.termstructures

Examples of org.jquantlib.termstructures.BlackVolTermStructure


        final SimpleQuote           qRate = new SimpleQuote(0.0);
        final YieldTermStructure    qTS   = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);

        for (int i=0; i<values.length-1; i++) {

            QL.debug(values[i].toString());
View Full Code Here


        final YieldTermStructure qTS   = Utilities.flatRate(today, qRate, dc);

        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);


        StrikedTypePayoff payoff;
        Date exDate;
        Exercise exercise;
View Full Code Here

        final SimpleQuote           qRate = new SimpleQuote(0.0);
        final YieldTermStructure    qTS   = Utilities.flatRate(qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(vol, dc);

        for (final Type type : types) {
            for (final double strike : strikes) {
                for (final double residualTime : residualTimes) {
View Full Code Here

        final SimpleQuote           qRate = new SimpleQuote(0.0);
        final YieldTermStructure    qTS   = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);

        for (final Type type : types) {
            for (final double strike2 : strikes) {
                for (final int length : lengths) {
                    // option to check
View Full Code Here

        final SimpleQuote           qRate = new SimpleQuote(0.05);
        final YieldTermStructure    qTS   = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.003);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.20);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);

        final Date exerciseDate = today.add(Period.ONE_YEAR_FORWARD);
        final Exercise exercise = new EuropeanExercise(exerciseDate);
        final StrikedTypePayoff payoff = new PlainVanillaPayoff(Option.Type.Call, 100);
View Full Code Here

        final SimpleQuote           qRate = new SimpleQuote(0.0);
        final YieldTermStructure    qTS   = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);

        for (final Type type : types) {
            for (final double strike3 : strikes) {
                for (final int length2 : lengths) {
View Full Code Here

        final DayCounter dc = new Actual360();
        final Date today = Date.todaysDate();

        final SimpleQuote spot = new SimpleQuote(0.0);
        final SimpleQuote vol = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);
        final SimpleQuote qRate = new SimpleQuote(0.0);
        final YieldTermStructure qTS = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote rRate = new SimpleQuote(0.0);
        final YieldTermStructure rTS = Utilities.flatRate(today, rRate, dc);
View Full Code Here

        // obtain local copies of objects
        final Quote u = underlying_.currentLink();
        final YieldTermStructure dTS = dividendTS_.currentLink();
        final YieldTermStructure rTS = riskFreeTS_.currentLink();
        final BlackVolTermStructure bTS = blackTS_.currentLink();

        final double forwardValue = u.value() * ( dTS.discount(time, true) / rTS.discount(time, true) );

        // strike derivatives
        /*@Real*/ double strike;
        /*@Real*/ double strikem;
        /*@Real*/ double strikep;
        double y, dy;
        double w, wp, wm, dwdy, d2wdy2;
        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);

        // time derivative
        /*@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);
            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

        // obtain local copies of objects
        final Quote u = underlying_.currentLink();
        final YieldTermStructure dTS = dividendTS_.currentLink();
        final YieldTermStructure rTS = riskFreeTS_.currentLink();
        final BlackVolTermStructure bTS = blackTS_.currentLink();

        final double forwardValue = u.value() * ( dTS.discount(time, true) / rTS.discount(time, true) );

        // strike derivatives
        /*@Real*/ double strike;
        /*@Real*/ double strikem;
        /*@Real*/ double strikep;
        double y, dy;
        double w, wp, wm, dwdy, d2wdy2;
        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);

        // time derivative
        /*@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);
            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

        final SimpleQuote           qRate = new SimpleQuote(0.0);
        final YieldTermStructure    qTS   = Utilities.flatRate(today, qRate, dc);
        final SimpleQuote           rRate = new SimpleQuote(0.0);
        final YieldTermStructure    rTS   = Utilities.flatRate(today, rRate, dc);
        final SimpleQuote           vol   = new SimpleQuote(0.0);
        final BlackVolTermStructure volTS = Utilities.flatVol(today, vol, dc);

        for (int i=0; i<values.length-1; i++) {

            QL.debug(values[i].toString());
View Full Code Here

TOP

Related Classes of org.jquantlib.termstructures.BlackVolTermStructure

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.