Example #1
0
        static void Main(string[] args)
        {
            //DirectoryInfo directoryinfo = new DirectoryInfo();
            GetTree getTree = new GetTree();

            getTree.GettingTree();
        }
        /*! \param maxTimeSteps is used to limit timeSteps when using Boyle-Lau
         *           optimization. If zero (the default) the maximum number of
         *           steps is calculated by an heuristic: anything when < 1000,
         *           otherwise no more than 5*timeSteps.
         *           If maxTimeSteps is equal to timeSteps Boyle-Lau is disabled.
         *           Likewise if the lattice is not CoxRossRubinstein Boyle-Lau is
         *           disabled and maxTimeSteps ignored.
         */
        public BinomialBarrierEngine(GetTree getTree, GetAsset getAsset,
                                     GeneralizedBlackScholesProcess process, int timeSteps, int maxTimeSteps = 0)
        {
            process_      = process;
            timeSteps_    = timeSteps;
            maxTimeSteps_ = maxTimeSteps;
            getTree_      = getTree;
            getAsset_     = getAsset;

            Utils.QL_REQUIRE(timeSteps > 0, () =>
                             "timeSteps must be positive, " + timeSteps + " not allowed");
            Utils.QL_REQUIRE(maxTimeSteps == 0 || maxTimeSteps >= timeSteps, () =>
                             "maxTimeSteps must be zero or greater than or equal to timeSteps, " + maxTimeSteps + " not allowed");
            if (maxTimeSteps_ == 0)
            {
                maxTimeSteps_ = Math.Max(1000, timeSteps_ * 5);
            }
            process_.registerWith(update);
        }