Exemple #1
0
        public void AddStock(DateTime dt, IStockData stock)
        {
            if (!DailyStocks_.ContainsKey(dt))
            {
                DailyStocks_.Add(dt, stock);
            }
            else
            {
                // ???
                // 2009-08-25
            }

            MinDate = (MinDate > dt) ? dt : MinDate;
            MaxDate = (MaxDate < dt) ? dt : MaxDate;
        }
Exemple #2
0
        private void InitSTocks2()
        {
            DateTime startTime = new DateTime(2009, 10, 12);

            DailyStocks_.Add(startTime,
                             FakeStockDataCreator.Create(startTime, 100, 103, 99, 99, 1000));
            DailyStocks_.Add(new DateTime(2009, 10, 13),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 13), 102, 106, 101, 105, 1500));
            DailyStocks_.Add(new DateTime(2009, 10, 14),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 14), 101, 108, 100, 102, 800));
            DailyStocks_.Add(new DateTime(2009, 10, 15),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 15), 104, 109, 102, 105, 1100));
            DailyStocks_.Add(new DateTime(2009, 10, 16),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 16), 103, 106, 100, 104, 900));

            DailyStocks_.Add(new DateTime(2009, 10, 17),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 17), 102, 106, 101, 105, 2000));
            DailyStocks_.Add(new DateTime(2009, 10, 18),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 18), 101, 108, 100, 102, 1000));
            DailyStocks_.Add(new DateTime(2009, 10, 19),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 19), 104, 109, 102, 105, 1000));
            DailyStocks_.Add(new DateTime(2009, 10, 20),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 20), 103, 106, 100, 104, 1000));

            DailyStocks_.Add(new DateTime(2009, 10, 21),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 21), 102, 106, 101, 105, 1300));
            DailyStocks_.Add(new DateTime(2009, 10, 22),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 22), 101, 108, 100, 102, 1000));
            DailyStocks_.Add(new DateTime(2009, 10, 23),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 23), 104, 109, 102, 105, 1600));
            DailyStocks_.Add(new DateTime(2009, 10, 24),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 24), 103, 106, 100, 104, 1000));

            DailyStocks_.Add(new DateTime(2009, 10, 25),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 25), 102, 106, 101, 105, 600));
            DailyStocks_.Add(new DateTime(2009, 10, 26),
                             FakeStockDataCreator.Create(new DateTime(2009, 10, 26), 101, 108, 100, 102, 1000));

            AllDates_.Clear();
            AllDates_.AddRange(DailyStocks_.Keys);
            AllDates_.Sort();
        }
Exemple #3
0
        private void AddDateStock(int date, double startPrice, double endPrice, double maxPrice, double minPrice, int volumehand)
        {
            DateTime dt = new DateTime(2009, 10, date);

            DailyStocks_.Add(dt, FakeStockDataCreator.Create(dt, startPrice, maxPrice, minPrice, endPrice, volumehand));
        }