Beispiel #1
0
        public static double BM(double S, double X, double t, double s, double r, EPutCall PutCall, int n)
        {
            double F  = 0.0;
            double x1 = FinMath.u(t, s, n);
            double x2 = FinMath.d(t, s, n);
            double p  = FinMath.p(t, s, n, r);

            for (int m = 0; m <= n; ++m)
            {
                F += FinMath.Binom(m, n, p) * FinMath.Payoff(S * Math.Pow(x1, (double)m) * Math.Pow(x2, (double)(n - m)), X, PutCall);
            }
            return(FinMath.PV4(F, r, t));
        }