Exemplo n.º 1
0
        public virtual double vega(double strike, double discount = 1.0)
        {
            double?atm = atmLevel();

            Utils.QL_REQUIRE(atm != null, () =>
                             "smile section must provide atm level to compute option vega");
            if (volatilityType() == VolatilityType.ShiftedLognormal)
            {
                return(Utils.blackFormulaVolDerivative(strike, atmLevel().Value,
                                                       Math.Sqrt(variance(strike)),
                                                       exerciseTime(), discount, shift()) * 0.01);
            }
            else
            {
                Utils.QL_FAIL("vega for normal smilesection not yet implemented");
            }

            return(0);
        }