Examples of optionType()


Examples of org.jquantlib.instruments.AssetOrNothingPayoff.optionType()

            @Override
            public void visit(final Payoff o) {
                final AssetOrNothingPayoff payoff = (AssetOrNothingPayoff)o;
                black.beta = black.dBeta_dD2 = 0.0;
                final Option.Type optionType = payoff.optionType();
                if (optionType == Option.Type.Call) {
                    black.alpha = black.cum_d1;
                    black.dAlpha_dD1 = black.n_d1;
                } else if (optionType == Option.Type.Put) {
                    black.alpha = 1.0 - black.cum_d1;
View Full Code Here

Examples of org.jquantlib.instruments.AssetOrNothingPayoff.optionType()

            @Override
            public void visit(final Payoff o) {
                final AssetOrNothingPayoff payoff = (AssetOrNothingPayoff)o;
                black.beta = black.dBeta_dD2 = 0.0;
                final Option.Type optionType = payoff.optionType();
                if (optionType == Option.Type.Call) {
                    black.alpha = black.cum_d1;
                    black.dAlpha_dD1 = black.n_d1;
                } else if (optionType == Option.Type.Put) {
                    black.alpha = 1.0 - black.cum_d1;
View Full Code Here

Examples of org.jquantlib.instruments.CashOrNothingPayoff.optionType()

            public final void visit(final Payoff o) {
                final CashOrNothingPayoff payoff = (CashOrNothingPayoff)o;
                black.alpha = black.dAlpha_dD1 = 0.0;
                black.x = payoff.getCashPayoff();
                black.dx_dStrike = 0.0;
                final Option.Type optionType = payoff.optionType();
                if (optionType == Option.Type.Call) {
                    black.beta = black.cum_d2;
                    black.dBeta_dD2 = black.n_d2;
                } else if (optionType == Option.Type.Put) {
                    black.beta = 1.0 - black.cum_d2;
View Full Code Here

Examples of org.jquantlib.instruments.CashOrNothingPayoff.optionType()

            public final void visit(final Payoff o) {
                final CashOrNothingPayoff payoff = (CashOrNothingPayoff)o;
                black.alpha = black.dAlpha_dD1 = 0.0;
                black.x = payoff.getCashPayoff();
                black.dx_dStrike = 0.0;
                final Option.Type optionType = payoff.optionType();
                if (optionType == Option.Type.Call) {
                    black.beta = black.cum_d2;
                    black.dBeta_dD2 = black.n_d2;
                } else if (optionType == Option.Type.Put) {
                    black.beta = 1.0 - black.cum_d2;
View Full Code Here

Examples of org.jquantlib.instruments.PlainVanillaPayoff.optionType()

            sb.append("    tol ").append(values[i].tol); // .append('\n');

            if (error<=tolerance) {
                QL.info(" error="+error);
            } else {
                fail(exercise + " " + payoff.optionType() + " option with " + payoff + " payoff:\n"
                        + "    spot value:       " + values[i].s + "\n"
                        + "    strike:           " + payoff.strike() + "\n"
                        + "    dividend yield:   " + values[i].q + "\n"
                        + "    risk-free rate:   " + values[i].r + "\n"
                        + "    reference date:   " + today + "\n"
View Full Code Here

Examples of org.jquantlib.instruments.PlainVanillaPayoff.optionType()

        double /* @DiscountFactor */riskFreeDiscount = process.riskFreeRate().currentLink().discount(ex.lastDate());
        double /* @Real */spot = process.stateVariable().currentLink().value();
        QL.require(spot > 0.0, "negative or null underlying given"); // QA:[RG]::verified // TODO: message
        double /* @Real */strike = payoff.strike();

        if (payoff.optionType()==Option.Type.Put) {
            // use put-call symmetry
            // swap spot and strike, has to be done inline
            double tmp = spot; spot = strike; strike = tmp;

            // swap riskFreeDiscount and dividenDiscount, has to be done inline
View Full Code Here

Examples of org.jquantlib.instruments.PlainVanillaPayoff.optionType()

        double /* @DiscountFactor */riskFreeDiscount = process.riskFreeRate().currentLink().discount(ex.lastDate());
        double /* @Real */spot = process.stateVariable().currentLink().value();
        QL.require(spot > 0.0, "negative or null underlying given"); // TODO: message
        double /* @Real */strike = payoff.strike();

        if (payoff.optionType()==Option.Type.Put) {
            // use put-call symmetry
            // swap spot and strike, has to be done inline
            double tmp = spot; spot = strike; strike = tmp;

            // swap riskFreeDiscount and dividenDiscount, has to be done inline
View Full Code Here

Examples of org.jquantlib.instruments.PlainVanillaPayoff.optionType()

            sb.append("    tol ").append(values[i].tol); // .append('\n');

            if (error<=tolerance) {
                QL.info(" error="+error);
            } else {
                fail(exercise + " " + payoff.optionType() + " option with " + payoff + " payoff:\n"
                        + "    spot value:       " + values[i].s + "\n"
                        + "    strike:           " + payoff.strike() + "\n"
                        + "    dividend yield:   " + values[i].q + "\n"
                        + "    risk-free rate:   " + values[i].r + "\n"
                        + "    reference date:   " + today + "\n"
View Full Code Here

Examples of org.jquantlib.instruments.StrikedTypePayoff.optionType()

            sb.append("    tol ").append(values[i].tol); // .append('\n');

            if (error<=tolerance) {
                QL.info(" error="+error);
            } else {
                fail(exercise + " " + payoff.optionType() + " option with " + payoff + " payoff:\n"
                        + "    spot value:       " + values[i].s + "\n"
                        + "    strike:           " + payoff.strike() + "\n"
                        + "    dividend yield:   " + values[i].q + "\n"
                        + "    risk-free rate:   " + values[i].r + "\n"
                        + "    reference date:   " + today + "\n"
View Full Code Here

Examples of org.jquantlib.instruments.StrikedTypePayoff.optionType()

            Nx_1 = (muG > Math.log(payoff.strike()) ? 1.0 : 0.0);
            nx_1 = 0.0;
        }
        greeks.vega = forwardPrice * riskFreeDiscount * ( (dmuG_dsig + sigG * dsigG_dsig)*Nx_1 + nx_1*dsigG_dsig );

        if (payoff.optionType() == Option.Type.Put) {
            greeks.vega -= riskFreeDiscount * forwardPrice * (dmuG_dsig + sigG * dsigG_dsig);
        }

        /*@Time*/ final double tRho = rfdc.yearFraction(process.riskFreeRate().currentLink().referenceDate(), a.exercise.lastDate());
        greeks.rho = black.rho(tRho)*timeSum/(N*tRho) - (tRho-timeSum/N) * r.value;
 
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.