Example #1
0
        public static double BsCallDelta(double s, double k, double r, double σ, double q, double T)
        {
            var d1 = (Log(s / k) + T * (r - q + σ * σ / 2)) / (σ * Sqrt(T));
            var n1 = ExcelFunc.NormCdf(d1);

            return(Exp(-q * T) * n1);
        }
Example #2
0
        public static double BsCallRho(double s, double k, double r, double σ, double q, double T)
        {
            var d1 = (Log(s / k) + (r - q + 0.5 * σ * σ) * T) / (σ * Sqrt(T));
            var d2 = d1 - σ * Sqrt(T);
            var n2 = ExcelFunc.NormCdf(d2);

            return(T * Exp(-r * T) * k * n2);
        }
Example #3
0
        public static double BsCall(double s, double k, double r, double σ, double q, double T)
        {
            var d1 = (Log(s / k) + T * (r - q + σ * σ / 2)) / (σ * Sqrt(T));
            var d2 = (Log(s / k) + T * (r - q - σ * σ / 2)) / (σ * Sqrt(T));
            var n1 = ExcelFunc.NormCdf(d1);
            var n2 = ExcelFunc.NormCdf(d2);

            return(Exp(-q * T) * s * n1 - Exp(-r * T) * k * n2);
        }
Example #4
0
        public static double BsCallTheta(double s, double k, double r, double σ, double q, double T)
        {
            var d1  = (Log(s / k) + (r - q + 0.5 * σ * σ) * T) / (σ * Sqrt(T));
            var d2  = d1 - σ * Sqrt(T);
            var n1  = ExcelFunc.NormCdf(d1);
            var n2  = ExcelFunc.NormCdf(d2);
            var nd1 = Exp(-d1 * d1 / 2) / Sqrt(2 * PI);

            return(-Exp(-q * T) * s * nd1 * σ / 2 / Sqrt(T) + q * Exp(-q * T) * s * n1 - r * Exp(-r * T) * k * n2);
        }