예제 #1
0
        static void DownloadCME_EODTrades(LogHelper log)
        {
            AppDAL        appDAL    = new AppDAL();
            CME_EODTrades eodTrades = new CME_EODTrades();

            log.Log("Downloading CME EOD Trade file..");
            int downloaded = 0;

            WinSCPHelper scp = new WinSCPHelper();
            // Get the list of items to process
            List <SFTPFileCollection> fileCollection = appDAL.GetSFTPAppSettingsByCode(sftpFileCode);            //Get SFTP Credentials from DB

            //checked if file is already available in local folder - means already downloaded
            List <SFTPFileCollection> fileCollectionLeft = checkLocalFile(fileCollection, dateFilesToGet, log);

            if (fileCollectionLeft.Count <= 0)
            {
                log.Log("No files to be downloaded.  Files might be already existing in local folder.");
                return;
            }

            string processTime = DateTime.Now.ToString();

            Console.WriteLine("Start processing at {0}", processTime);
            log.Log("Starts - " + processTime);
            while (fileCollectionLeft.Count > 0)
            {
                // Set up session options
                fileCollectionLeft = scp.InitWinSCPSession(fileCollectionLeft, log, dateFilesToGet);

                if (fileCollectionLeft.Count > 0)
                {
                    string mesg = "Still waiting for " + fileCollectionLeft.Count.ToString() + " file(s) from CME.  Next file check will be at " + DateTime.Now.AddMilliseconds(300000) + " for the remaining files";

                    eodTrades.ExtractCME_Heartbit_Email(log, mesg);

                    Console.WriteLine(mesg);
                    Thread.Sleep(60000);                     //60 seconds

                    Console.Clear();
                }
            }
        }
예제 #2
0
        static void DownloadCQAPI_EODTradeVolume(LogHelper log)
        {
            CME_EODTrades eodTrades = new CME_EODTrades();

            eodTrades.GetCQAPI_EODVolume(log);
        }
예제 #3
0
        static void ExtractCME_EODTrades(LogHelper log)
        {
            CME_EODTrades eodTrades = new CME_EODTrades();

            eodTrades.ExtractCME_EODTrades(log);
        }