Exemple #1
0
        private void buttonCalc_Click(object sender, EventArgs e)
        {
            SetUserDefinedDate();

            log_.Info("==>Calculate start. Start Date = " + History_.MinDate.ToLongDateString()
                      + ", End Date = " + History_.MaxDate.ToLongDateString());

            FormStrategy frm = new FormStrategy();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                log_.Info("<==Calculate end. Not select strategy. ");
                return;
            }

            FinanceRunner runner = new FinanceRunner();

            runner.CurrentBonusProcessor = BonusProcessor_;

            runner.Go(History_, frm.Factory);

            _results = runner.Results;
            log_.Info("<==Calculate complete. ");

            ShowCompareResults();
        }
Exemple #2
0
        public void Go()
        {
            FakeStockHistory hist = new FakeStockHistory();

            hist.Init();

            LogMgr.Logger = new DummyLog();

            FinanceRunner runner = new FinanceRunner();

            runner.CurrentBonusProcessor = new FakeIBonusProcessor();
            IStrategyFactory factory = StrategyFactoryCreater.Instance().CreateFactory(StrategyFactoryType.Normal);

            runner.Go(hist, factory);

            StrategyResults results = runner.Results;

            Assert.IsTrue(results.AllStrategyNames.Count > 0);

            LogMgr.Logger.Close();
        }