Package org.jquantlib.exercise

Examples of org.jquantlib.exercise.Exercise


        for (final Type type : types)
            for (final double strike : strikes)
                for (final int length : lengths) {
                    final Date exDate = today.add(length * 360);
                    final Exercise exercise = new EuropeanExercise(exDate);
                    final StrikedTypePayoff payoff = new PlainVanillaPayoff(type, strike);

                    // reference option
                    final VanillaOption refOption = makeOption(payoff, exercise, spot, qTS, rTS, volTS, EngineType.Analytic,
                            Constants.NULL_INTEGER, Constants.NULL_INTEGER);
View Full Code Here


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

        for (final NewBarrierOptionData value : values) {
            final Date exDate = today.add( timeToDays(value.t) );
            final Exercise exercise = new EuropeanExercise(exDate);

            spot.setValue(value.s);
            qRate.setValue(value.q);
            rRate.setValue(value.r);
            vol.setValue(value.v);
View Full Code Here

        final YieldTermStructure    rTS        = Utilities.flatRate(today, rH_SME, dc);
        final SimpleQuote           volatility = new SimpleQuote(0.10);
        final BlackVolTermStructure volTS      = Utilities.flatVol(today, volatility, dc);

        final Date exDate = today.add(360);
        final Exercise exercise = new EuropeanExercise(exDate);

        for (final BarrierOptionData value : values) {
            volatility.setValue(value.volatility);
            final StrikedTypePayoff callPayoff = new PlainVanillaPayoff(Option.Type.Call, value.strike);
View Full Code Here

        final SimpleQuote           volatility = new SimpleQuote(0.10);
        final BlackVolTermStructure volTS      = Utilities.flatVol(today, volatility, dc);

        final Date exDate = today.add(360);

        final Exercise exercise = new EuropeanExercise(exDate);

        for (final BarrierOptionData value : values) {
            volatility.setValue(value.volatility);
            final StrikedTypePayoff callPayoff = new PlainVanillaPayoff(Option.Type.Call, value.strike);
View Full Code Here

    final CommonVars vars = new CommonVars();

    vars.conversionRatio = 1.0e-16;

    final Exercise euExercise = new EuropeanExercise(vars.maturityDate);
    final Exercise amExercise = new AmericanExercise(vars.issueDate,
        vars.maturityDate);

    final int timeSteps = 1001;
    final PricingEngine engine = new BinomialConvertibleEngine<CoxRossRubinstein>(
        CoxRossRubinstein.class,
View Full Code Here

    QL.info("Testing zero-coupon convertible bonds against vanilla option...");

    final CommonVars vars = new CommonVars();

    final Exercise euExercise = new EuropeanExercise(vars.maturityDate);

    vars.settlementDays = 0;

    final int timeSteps = 1001;
    final PricingEngine engine = new BinomialConvertibleEngine<CoxRossRubinstein>(CoxRossRubinstein.class, vars.process, timeSteps);
View Full Code Here

        final Option.Type type = Option.Type.Call;
        /* @Real */final double strike = 100.0;
        final StrikedTypePayoff payoff = new PlainVanillaPayoff(type, strike);

        final Date exerciseDate = today.clone().addAssign(360);
        final Exercise exercise = new EuropeanExercise(exerciseDate);

        QL.info("Exercise: " + exerciseDate);
        QL.info("Df: " + rTS.discount(exerciseDate));
        QL.info("DivDf: " + qTS.discount(exerciseDate));

View Full Code Here

        /* @Size */int pastFixings = Integer.MAX_VALUE;
        /* @Real */double runningAccumulator = Double.NaN;

        final StrikedTypePayoff payoff = new PlainVanillaPayoff(type, strike);
        final Exercise exercise = new EuropeanExercise(exerciseDate);

        final ContinuousAveragingAsianOption option = new ContinuousAveragingAsianOption(averageType, payoff, exercise);
        option.setPricingEngine(engine);

        /* @Real */double calculated = option.NPV();
View Full Code Here

            final StrikedTypePayoff payoff = new PlainVanillaPayoff(value.type, value.strike);

            final int daysToExpiry = (int) (value.t * 360 + 0.5);
            final Date exDate = today.clone().addAssign(daysToExpiry);
            final Exercise exercise = new AmericanExercise(today, exDate);

            spot.setValue(value.s);
            qRate.setValue(value.q);
            rRate.setValue(value.r);
            vol.setValue(value.v);
View Full Code Here

        final double /* @Real */tolerance = 3.0e-3;

        for (final AmericanOptionData value : values) {
            final StrikedTypePayoff payoff = new PlainVanillaPayoff(value.type, value.strike);
            final Date exDate = today.add(timeToDays(value.t));
            final Exercise exercise = new AmericanExercise(today, exDate);

            spot.setValue(value.s);
            qRate.setValue(value.q);
            rRate.setValue(value.r);
            vol.setValue(value.v);
View Full Code Here

TOP

Related Classes of org.jquantlib.exercise.Exercise

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.