Examples of EuropeanExercise


Examples of org.jquantlib.exercise.EuropeanExercise

        for (final Type type : types)
            for (final double strike : strikes)
                for (final int length : lengths) {
                  final Date exDate = today.add(new Period(length, TimeUnit.Years));
                  final Exercise exercise = new EuropeanExercise(exDate);

                  final List<Date> dividendDates = new ArrayList<Date>();
                  final List</* @Real */ Double> dividends = new ArrayList<Double>();
                  dividendDates.add(exercise.lastDate());
                  dividends.add(dividendValue);

                  final StrikedTypePayoff payoff = new PlainVanillaPayoff(type, strike);
                  final StrikedTypePayoff refPayoff = new PlainVanillaPayoff(type, strike + dividendValue);
                  final BlackScholesMertonProcess stochProcess = new BlackScholesMertonProcess(new Handle<Quote>(spot), qTS, rTS, volTS);
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        for (final Type type : types)
            for (final double strike : strikes)
                for (final int length : lengths) {
                  final Date exDate = today.add(new Period(length, TimeUnit.Years));
                  final Exercise exercise = new EuropeanExercise(exDate);

                  final List<Date> dividendDates = new ArrayList<Date>();
                  final List</* @Real */ Double> dividends = new ArrayList<Double>();
                  for (final Date d = today.add(new Period(3, TimeUnit.Months));
                             d.lt(exercise.lastDate());
                             d.addAssign(new Period(6, TimeUnit.Months))) {
                      dividendDates.add(d.clone());
                      dividends.add(5.0);
                  }

View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        for (final Type type : types)
            for (final double strike : strikes)
                for (final int length : lengths) {
                  final Date exDate = today.add(new Period(length, TimeUnit.Years));
                  final Exercise exercise = new EuropeanExercise(exDate);

                  final List<Date> dividendDates = new ArrayList<Date>();
                  final List</* @Real */ Double> dividends = new ArrayList<Double>();
                  for (final Date d = today.add(new Period(3, TimeUnit.Months));
                             d.lt(exercise.lastDate());
                             d.addAssign(new Period(6, TimeUnit.Months))) {
                      dividendDates.add(d.clone());
                      dividends.add(5.0);
                  }

View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        /* @Integer */ final int lengths[] = { 1, 2 };

        for (final int length : lengths) {
            final Date exDate = today.add(new Period(length, TimeUnit.Years));
            final Exercise exercise = new EuropeanExercise(exDate);
            testFdGreeks(FDDividendEuropeanEngine.class, today, exercise);
        }
    }
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        QL.info("Testing degenerate finite-differences dividend European option...");

        final Date today = new Date(27, Month.February, 2005);
        new Settings().setEvaluationDate(today);
        final Date exDate = new Date(13, Month.April, 2005);
        final Exercise exercise = new EuropeanExercise(exDate);
        testFdDegenerate(FDDividendEuropeanEngine.class, today, exercise);
    }
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        //                 "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
        System.out.println("                            Method      European      Bermudan      American");
        System.out.println("================================== ============= ============= =============");

        // Define exercise for European Options
        final Exercise europeanExercise = new EuropeanExercise(maturity);

        // Define exercise for Bermudan Options
        final int bermudanForwards = 4;
        final Date[] exerciseDates = new Date[bermudanForwards];
        for (int i = 1; i <= bermudanForwards; i++) {
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        //                 "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
        System.out.println("                            Method      European      Bermudan      American");
        System.out.println("================================== ============= ============= =============");

        // Define exercise for European Options
        final Exercise europeanExercise = new EuropeanExercise(maturity);

        // Define exercise for Bermudan Options
    final int bermudanForwards = 4;
    final Date[] exerciseDates = new Date[bermudanForwards];
    for (int i = 1; i <= bermudanForwards; i++) {
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        System.out.println("Tsiveriotis-Fernandes method");
        System.out.println("                         Tree type      European      American");
        System.out.println("================================== ============= =============");


        final Exercise europeanExercise = new EuropeanExercise(exerciseDate);
        final Exercise americanExercise = new AmericanExercise(settlementDate,exerciseDate);

        final Handle<Quote> underlyingH = new Handle<Quote>(new SimpleQuote(underlying));
        final Handle<YieldTermStructure> flatTermStructure = new Handle<YieldTermStructure>(
                new FlatForward(settlementDate, riskFreeRate, dayCounter));
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

            final Handle<Quote> h2 = new Handle<Quote>(volatility.currentLink());
            final Handle<YieldTermStructure> flatRate = new Handle<YieldTermStructure>(new FlatForward(0, new NullCalendar(), h1, dayCounter));
            final Handle<BlackConstantVol> flatVol = new Handle<BlackConstantVol>(new BlackConstantVol(0, new NullCalendar(), h2, dayCounter));

            //instantiate the option
            final Exercise exercise = new EuropeanExercise(maturity);
            final Payoff payoff = new PlainVanillaPayoff(type, strike);

            //FIXME:Review BlackScholes, GeneralizedBlackScholesStochasticProcess
            //Handle<StochasticProcess> stochasticProcess = new Handle<StochasticProcess>(new GeneralizedBlackScholesProcess(underlying, flatRate, flatVol));
View Full Code Here

Examples of org.jquantlib.exercise.EuropeanExercise

        else   if(optionType.equalsIgnoreCase("put") || optionType.equalsIgnoreCase("p")){
            type = Option.Type.Put;
        }
        else throw new IllegalArgumentException("Invalid option type");

        Exercise europeanExercise = new EuropeanExercise(maturityDate);
        Payoff payoff = new PlainVanillaPayoff(type, strike);

        final Calendar calendar = new Target();
        Handle<Quote> underlyingH = new Handle<Quote>(new SimpleQuote(underlying));
        Handle<YieldTermStructure> flatDividendTS = new Handle<YieldTermStructure>(new FlatForward(settlementDate, dividendYield, dayCounter));
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.