Пример #1
0
        public double[] Run()
        {
            double[] path          = new double[Steps + 1];
            double   dt            = Discretisation.Expiry / Steps;
            double   previousValue = 0.0;
            double   nextValue     = 0.0;

            for (int i = 0; i < Paths; i++)
            {
                path[0] = previousValue = Discretisation.InitialPrice;

                for (int j = 1; j <= Steps; j++)
                {
                    nextValue     = Discretisation.Next(previousValue, dt, RdmGenerator.RandomGenerator());
                    path[j]       = nextValue;
                    previousValue = nextValue;
                }
                ProcessPath(ref path);
            }
            StopProcess();
            return(path);
        }