Пример #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);
        }
Пример #2
0
        public void TestDownloadKLine()
        {
            List <string[]> arr = Download_DayKLine.RequestIndex("sz000002", 20171009);

            for (int i = 0; i < arr.Count; i++)
            {
                Console.WriteLine(ListUtils.ToString(arr[i]));
            }
        }