Exemple #1
0
        private void InitStocks()
        {
            int currentDate = 1;

            AddDateStock(currentDate, 100, 100, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 102, 103, 105, 95, 1200); currentDate++;
            AddDateStock(currentDate, 105, 108, 108, 99, 1400); currentDate++;
            AddDateStock(currentDate, 100, 100, 105, 95, 800); currentDate++;
            AddDateStock(currentDate, 100, 90, 100, 90, 1000); currentDate++;
            AddDateStock(currentDate, 95, 103, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 100, 97, 101, 96, 1000); currentDate++;
            AddDateStock(currentDate, 97, 93, 98, 90, 900); currentDate++;
            AddDateStock(currentDate, 93, 89, 94, 89, 800); currentDate++;
            AddDateStock(currentDate, 100, 101, 102, 99, 3000); currentDate++;
            AddDateStock(currentDate, 97, 100, 105, 97, 1000); currentDate++;
            AddDateStock(currentDate, 96, 97, 98, 95, 1000); currentDate++;
            AddDateStock(currentDate, 100, 102, 102, 91, 1000); currentDate++;
            AddDateStock(currentDate, 91, 89, 93, 87, 4000); currentDate++;
            AddDateStock(currentDate, 93, 95, 97, 91, 1000); currentDate++;
            AddDateStock(currentDate, 95, 97, 97, 95, 2000); currentDate++;
            AddDateStock(currentDate, 99, 100, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 100, 101, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 101, 100, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 96, 100, 105, 95, 1000); currentDate++;
            AddDateStock(currentDate, 100, 98, 105, 95, 3000); currentDate++;
            AddDateStock(currentDate, 94, 98, 100, 95, 500); currentDate++;
            AddDateStock(currentDate, 100, 100, 105, 95, 1000); currentDate++;

            AllDates_.Clear();
            AllDates_.AddRange(DailyStocks_.Keys);
            AllDates_.Sort();
        }
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();
        }