Beispiel #1
0
        public void DownloadDates()
        {
            string     tradingdaypath = pathutils.GetPath_Tradingday();
            int        tradingDay     = -1;
            List <int> tradingDays    = null;

            if (File.Exists(tradingdaypath))
            {
                tradingDays = CsvUtils_TradingDay.Load(tradingdaypath);
                tradingDay  = tradingDays[tradingDays.Count - 1];
            }

            List <string[]> arr = Download_DayKLine.RequestIndex("sh000001", tradingDay);

            if (tradingDays == null)
            {
                tradingDays = new List <int>(arr.Count);
            }
            for (int i = 0; i < arr.Count; i++)
            {
                try
                {
                    tradingDays.Add(int.Parse(arr[i][0]));
                }
                catch (Exception e)
                {
                    Console.WriteLine(arr[i]);
                    Console.WriteLine(e.Message);
                }
            }
            CsvUtils_TradingDay.Save(tradingdaypath, tradingDays);
        }
Beispiel #2
0
        public string Proceed()
        {
            Download_Sina download    = new Download_Sina(DataConst.SINAPATH);
            List <int>    tradingDays = download.GetTradingDays();
            string        targetPath  = DataConst.CSVPATH + @"\tradingdays.csv";

            CsvUtils_TradingDay.Save(targetPath, tradingDays);
            return("更新完成交易日数据");
        }
Beispiel #3
0
 public void Save(List <int> tradingDays)
 {
     CsvUtils_TradingDay.Save(path, tradingDays);
 }