Package org.jquantlib.termstructures.volatilities

Examples of org.jquantlib.termstructures.volatilities.BlackConstantVol


        final Handle<Quote> stateVariable = new Handle(new SimpleQuote(s0_.doubleValue()));
        final Handle<YieldTermStructure> riskFreeRate = new Handle(new FlatForward(today, r_.doubleValue(), dayCount));

        final Handle<YieldTermStructure> dividendYield = new Handle(new FlatForward(today, 0.0, dayCount));

        final Handle<BlackVolTermStructure> volatility = new Handle(new BlackConstantVol(today, calendar, sigma_.doubleValue(),dayCount));

        final StochasticProcess1D diffusion = new BlackScholesMertonProcess(
                stateVariable, dividendYield, riskFreeRate, volatility);

View Full Code Here


        final Handle<YieldTermStructure> flatTermStructure = new Handle<YieldTermStructure>(
                new FlatForward(settlementDate, riskFreeRate, dayCounter));
        final Handle<YieldTermStructure> flatDividendTS = new Handle<YieldTermStructure>(
                new FlatForward(settlementDate, dividendYield, dayCounter));
        final Handle<BlackVolTermStructure> flatVolTS = new Handle<BlackVolTermStructure>(
                new BlackConstantVol(settlementDate, calendar, volatility, dayCounter));

        final BlackScholesMertonProcess stochasticProcess = new BlackScholesMertonProcess(
                underlyingH, flatDividendTS, flatTermStructure, flatVolTS);

        final int timeSteps = 801;
View Full Code Here

            //bootstrap the yield/vol curves
            final DayCounter dayCounter = new Actual365Fixed();
            final Handle<Quote> h1 = new Handle<Quote>(riskFreeRate.currentLink());
            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);
View Full Code Here

        final Date referenceDate = process.riskFreeRate().currentLink().referenceDate();

        // 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"); // TODO: message

        final double maturity = rfdc.yearFraction(referenceDate, maturityDate);
View Full Code Here

        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));
        Handle<YieldTermStructure> flatTermStructure = new Handle<YieldTermStructure>(new FlatForward(settlementDate, riskFreeRate, dayCounter));
        Handle<BlackVolTermStructure> flatVolTS = new Handle<BlackVolTermStructure>(new BlackConstantVol(settlementDate, calendar, volatility, dayCounter));

        GeneralizedBlackScholesProcess stochasticProcess = new BlackScholesMertonProcess(underlyingH, flatDividendTS, flatTermStructure, flatVolTS);

        VanillaOption europeanOption = new EuropeanOption(payoff, europeanExercise);
View Full Code Here

    static public YieldTermStructure flatRate(final/* @Rate */double forward, final DayCounter dc) {
        return flatRate(new SimpleQuote(forward), dc);
    }

    static public BlackVolTermStructure flatVol(final Date today, final Quote vol, final DayCounter dc) {
        return new BlackConstantVol(today, new NullCalendar(), new Handle<Quote>(vol), dc);
    }
View Full Code Here

    static public BlackVolTermStructure flatVol(final Date today, final/* @Volatility */double vol, final DayCounter dc) {
        return flatVol(today, new SimpleQuote(vol), dc);
    }

    static public BlackVolTermStructure flatVol(final Quote vol, final DayCounter dc) {
        return new BlackConstantVol(0, new NullCalendar(), new Handle<Quote>(vol), dc);
    }
View Full Code Here

        return new FlatForward(referenceDate, rate, dc);
    }


    private BlackVolTermStructure flatVol(final Date referenceDate, final Handle<SimpleQuote> vol, final Calendar cal, final DayCounter dc) {
        return new BlackConstantVol(referenceDate, cal, vol, dc);
    }
View Full Code Here

        return new FlatForward(referenceDate, rate, dc);
    }


    private BlackVolTermStructure flatVol(final Date referenceDate, final Handle<SimpleQuote> vol, final Calendar cal, final DayCounter dc) {
        return new BlackConstantVol(referenceDate, cal, vol, dc);
    }
View Full Code Here

       final Date referenceDate = process.riskFreeRate().currentLink().referenceDate();

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

TOP

Related Classes of org.jquantlib.termstructures.volatilities.BlackConstantVol

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.