Package org.jquantlib.instruments

Examples of org.jquantlib.instruments.PlainVanillaPayoff


       // binomial trees with constant coefficient
       final Handle<YieldTermStructure> flatRiskFree  = new Handle<YieldTermStructure>(new FlatForward(referenceDate, rRate, rfdc));
       final Handle<YieldTermStructure> flatDividends = new Handle<YieldTermStructure>(new FlatForward(referenceDate, qRate, divdc));
       final Handle<BlackVolTermStructure> flatVol = new Handle<BlackVolTermStructure>(new BlackConstantVol(referenceDate, volcal, v, voldc));
       final PlainVanillaPayoff payoff = (PlainVanillaPayoff) a.payoff;
       QL.require(payoff!=null , "non-plain payoff given"); // QA:[RG]::verified // TODO: message

       final double maturity = rfdc.yearFraction(referenceDate, maturityDate);

       final StochasticProcess1D bs = new GeneralizedBlackScholesProcess(process.stateVariable(), flatDividends, flatRiskFree, flatVol);
       final TimeGrid grid = new TimeGrid(maturity, timeSteps);
       final Tree tree = (Tree)getTreeInstance(bs, maturity, timeSteps, payoff.strike());

       final BlackScholesDividendLattice<Tree> lattice = new BlackScholesDividendLattice<Tree>(tree, rRate, maturity, timeSteps,
                                                                           rfdc, grid, referenceDate, a.cashFlow);
       final DiscretizedVanillaOption option = new DiscretizedVanillaOption(a, process, grid);
View Full Code Here


        final double /* @Real */tolerance = 1.0e-4;

        for (final AmericanOptionData value : values) {

            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);

View Full Code Here

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

        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);
View Full Code Here

        final double tolerance = 1.0e-3;

        for (final AmericanOptionData juValue : juValues) {

            final StrikedTypePayoff payoff = new PlainVanillaPayoff(juValue.type, juValue.strike);
            final Date exDate = today.add(timeToDays(juValue.t));
            final Exercise exercise = new AmericanExercise(today, exDate);

            spot.setValue(juValue.s);
            qRate.setValue(juValue.q);
View Full Code Here

            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);

            final StrikedTypePayoff payoff = new PlainVanillaPayoff(juValue.type, juValue.strike);
            final Date exDate = today.add(timeToDays(juValue.t));
            final Exercise exercise = new AmericanExercise(today, exDate);

            spot.setValue(juValue.s);
            qRate.setValue(juValue.q);
View Full Code Here

            for (final double strike : strikes) {
                for (final int year : years) {

                    final Date exDate = today.add(new Period(year, TimeUnit.Years));
                    final Exercise exercise = new AmericanExercise(today, exDate);
                    final StrikedTypePayoff payoff = new PlainVanillaPayoff(type, strike);

                    final BlackScholesMertonProcess stochProcess = new BlackScholesMertonProcess(
                            new Handle<Quote>(spot),
                            new Handle<YieldTermStructure>(qTS),
                            new Handle<YieldTermStructure>(rTS),
View Full Code Here

TOP

Related Classes of org.jquantlib.instruments.PlainVanillaPayoff

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.