Ejemplo n.º 1
0
        public void AddResult()
        {
            StrategyResults res = new StrategyResults();
            res.AddResult("Test", new StockValues());

            ICollection<string> names = res.AllStrategyNames;
            Assert.AreEqual(names.Count, 1);
        }
Ejemplo n.º 2
0
        public void GetResult()
        {
            StrategyResults res = new StrategyResults();
            res.AddResult("Test", new StockValues());

            IStockValues val = res.GetResult("Test");
            Assert.IsNotNull(val);

            val = res.GetResult("NOTEXIST");
            Assert.IsNull(val);
        }
Ejemplo n.º 3
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();
        }