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); }
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("更新完成交易日数据"); }
public void Save(List <int> tradingDays) { CsvUtils_TradingDay.Save(path, tradingDays); }