Examples of strike()


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

                                                    flatRiskFree, flatVol);
        // final T tree = new T(bs, maturity, timeSteps_, payoff.strike());
        final T tree;
        try {
            final Constructor<T> c = typeT.getConstructor(StochasticProcess1D.class, double.class, int.class, double.class);
            tree = typeT.cast( c.newInstance(bs, maturity, timeSteps_, payoff.strike() ));
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }

        final double creditSpread = this.a.creditSpread.currentLink().value();
View Full Code Here

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

        final AmericanExercise ex = (AmericanExercise)a.exercise;
        QL.require(!ex.payoffAtExpiry() , PAYOFF_AT_EXPIRY_NOT_HANDLED); // QA:[RG]::verified
        QL.require(a.payoff instanceof PlainVanillaPayoff , NON_PLAIN_PAYOFF_GIVEN); // QA:[RG]::verified
        PlainVanillaPayoff payoff = (PlainVanillaPayoff)a.payoff;

        final double /* @Real */variance = process.blackVolatility().currentLink().blackVariance(ex.lastDate(), payoff.strike());
        double /* @DiscountFactor */dividendDiscount = process.dividendYield().currentLink().discount(ex.lastDate());
        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();
View Full Code Here

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

        final double /* @Real */variance = process.blackVolatility().currentLink().blackVariance(ex.lastDate(), payoff.strike());
        double /* @DiscountFactor */dividendDiscount = process.dividendYield().currentLink().discount(ex.lastDate());
        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;
View Full Code Here

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

        final Date exercise = a.exercise.lastDate();

        QL.require(a.payoff instanceof PlainVanillaPayoff , "non-plain payoff given"); // TODO: message
        final PlainVanillaPayoff payoff = (PlainVanillaPayoff)arguments_.payoff;

        /*@Volatility*/ final double volatility = process.blackVolatility().currentLink().blackVol(exercise, payoff.strike());
        /*@Real*/ final double variance = process.blackVolatility().currentLink().blackVariance(exercise, payoff.strike());
        /*@DiscountFactor*/ final double  riskFreeDiscount = process.riskFreeRate().currentLink().discount(exercise);
        final DayCounter rfdc  = process.riskFreeRate().currentLink().dayCounter();
        final DayCounter divdc = process.dividendYield().currentLink().dayCounter();
        final DayCounter voldc = process.blackVolatility().currentLink().dayCounter();
View Full Code Here

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

        QL.require(a.payoff instanceof PlainVanillaPayoff , "non-plain payoff given"); // TODO: message
        final PlainVanillaPayoff payoff = (PlainVanillaPayoff)arguments_.payoff;

        /*@Volatility*/ final double volatility = process.blackVolatility().currentLink().blackVol(exercise, payoff.strike());
        /*@Real*/ final double variance = process.blackVolatility().currentLink().blackVariance(exercise, payoff.strike());
        /*@DiscountFactor*/ final double  riskFreeDiscount = process.riskFreeRate().currentLink().discount(exercise);
        final DayCounter rfdc  = process.riskFreeRate().currentLink().dayCounter();
        final DayCounter divdc = process.dividendYield().currentLink().dayCounter();
        final DayCounter voldc = process.blackVolatility().currentLink().dayCounter();

View Full Code Here

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

            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"
                        + "    maturity:         " + values[i].t + "\n"
                        + "    volatility:       " + values[i].v + "\n\n"
View Full Code Here

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

    public void calculate() /* @ReadOnly */ {
        QL.require(a.exercise.type() == Exercise.Type.European , NOT_AN_EUROPEAN_OPTION); // QA:[RG]::verified // TODO: message
        final StrikedTypePayoff payoff = (StrikedTypePayoff) a.payoff;
        QL.require(payoff != null , NON_STRIKED_PAYOFF_GIVEN); // QA:[RG]::verified // TODO: message

        /* @Variance */final double variance = process.blackVolatility().currentLink().blackVariance(a.exercise.lastDate(), payoff.strike());
        /* @DiscountFactor */final double dividendDiscount = process.dividendYield().currentLink().discount(a.exercise.lastDate());
        /* @DiscountFactor */final double riskFreeDiscount = process.riskFreeRate().currentLink().discount(a.exercise.lastDate());
        /* @Real */final double spot = process.stateVariable().currentLink().value();
        QL.require(spot > 0.0, "negative or null underlying given"); // QA:[RG]::verified // TODO: message
        /* @Real */final double forwardPrice = spot * dividendDiscount / riskFreeDiscount;
View Full Code Here

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

        double timeSum = 0.0;
        for (int k=0; k<fixingTimes.size(); k++) {
            timeSum += fixingTimes.get(k);
        }

        /*@Volatility*/ final double vola = process.blackVolatility().currentLink().blackVol(a.exercise.lastDate(), payoff.strike());

        /*@Real*/ double temp = 0.0;
        for (i=pastFixings+1; i<numberOfFixings; i++) {
            temp += fixingTimes.get(i-pastFixings-1)*(N-i);
        }
View Full Code Here

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

        /*@Real*/ double Nx_1, nx_1;
        final CumulativeNormalDistribution CND = new CumulativeNormalDistribution();
        final NormalDistribution ND = new NormalDistribution();

        if (sigG > Constants.QL_EPSILON) {
            /*@Real*/ final double x_1  = (muG-Math.log(payoff.strike())+variance)/sigG;
            Nx_1 = CND.op(x_1);
            nx_1 = ND.op(x_1);
        } else {
            Nx_1 = (muG > Math.log(payoff.strike()) ? 1.0 : 0.0);
            nx_1 = 0.0;
View Full Code Here

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

        if (sigG > Constants.QL_EPSILON) {
            /*@Real*/ final double x_1  = (muG-Math.log(payoff.strike())+variance)/sigG;
            Nx_1 = CND.op(x_1);
            nx_1 = ND.op(x_1);
        } else {
            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) {
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.