Examples of PlainVanillaPayoff


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
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.