Exemple #1
0
        public void Run()
        {
            string[] stockNames                = stocks.Keys.ToArray();
            int      dayInMilliseconds         = 1000 * 60 * 60 * 24;
            int      fiveMinutesInMilliseconds = 1000 * 5;

            logger.Info("Creating daily gatherer");
            YahooGathererDaily daily = new YahooGathererDaily(dayInMilliseconds, stockNames);

            logger.Info("Creating realtime gatherer which will sample every 5 minutes");
            YahooGathererRT rt = new YahooGathererRT(fiveMinutesInMilliseconds, stockNames);

            rt.DataUpdated    += AddRTToDB;
            daily.DataUpdated += AddDailyToDB;
        }
Exemple #2
0
        public void Run(int rtInterval = -1, int dailyInterval = -1)
        {
            if (rtInterval == -1)
            {
                rtInterval = 5000;
            }
            if (dailyInterval == -1)
            {
                dailyInterval = (1000 * 60 * 60 * 24);
            }
            string[] stockNames = stocks.Keys.ToArray();
            logger.Info("Creating daily gatherer");
            YahooGathererDaily daily = new YahooGathererDaily(dailyInterval, stockNames);

            logger.Info("Creating realtime gatherer which will sample every 5 minutes");
            YahooGathererRT rt = new YahooGathererRT(rtInterval, stockNames);

            rt.DataUpdated    += AddRTToDB;
            daily.DataUpdated += AddDailyToDB;
        }