Exemplo n.º 1
0
        private List <IStep> GetAllStep_Varieties()
        {
            List <IStep>    steps         = new List <IStep>();
            Step_CodeInfo   step_CodeInfo = new Step_CodeInfo(dataUpdateHelper);
            List <CodeInfo> allCodes      = step_CodeInfo.GetAllCodes();

            allCodes = FilterCodeInfo(allCodes, new string[] { "RB", "HC", "BU" });
            GetTradingTime(steps, allCodes, true);
            UpdatedDataInfo updatedDataInfo = new UpdatedDataInfo(targetDataPath);

            ITradingDayReader tradingDayReader = dataUpdateHelper.GetAllTradingDayReader();

            for (int i = 0; i < allCodes.Count; i++)
            {
                CodeInfo codeInfo  = allCodes[i];
                int      startDate = codeInfo.Start;
                if (startDate == 0)
                {
                    startDate = tradingDayReader.FirstTradingDay;
                }

                int endDate = codeInfo.End;
                if (endDate <= 0)
                {
                    endDate = tradingDayReader.LastTradingDay;
                }
                List <int> tradingDays = new List <int>();
                tradingDays.AddRange(tradingDayReader.GetTradingDays(startDate, endDate));
                GetKLineDataSteps(steps, codeInfo, tradingDays, updatedDataInfo);
            }
            return(steps);
        }
Exemplo n.º 2
0
        public List <IStep> GetAllSteps()
        {
            //return GetAllStep_Varieties();
            if (dataProvider.GetAppointUpdate() != null)
            {
                return(GetAllStep_UpdateAppoint());
            }
            List <IStep> steps = new List <IStep>();

            UpdatedDataInfo updatedDataInfo = new UpdatedDataInfo(targetDataPath);

            Step_CodeInfo   step_CodeInfo = new Step_CodeInfo(dataUpdateHelper);
            List <CodeInfo> allCodes      = step_CodeInfo.GetAllCodes();

            steps.Add(step_CodeInfo);
            steps.Add(new Step_TradingDay(dataUpdateHelper));
            GetTradingTime(steps, allCodes, false);
            //GetTradingTime(steps, allCodes, true);
            GetTickSteps(steps, updatedDataInfo, allCodes);
            GetKLineDataSteps(steps, updatedDataInfo, allCodes);

            //GetTickDataSteps_Day_All(steps, 20180102, allCodes);
            //GetTickDataSteps_Day_All(steps, 20170719, allCodes);
            //GetTickDataSteps_Day_All(steps, 20170720, allCodes);
            //GetTickDataSteps_Day_All(steps, 20170721, allCodes);

            //GetKLineDataSteps_Day(steps, 20180102, allCodes);
            //GetKLineDataSteps_Day(steps, 20170719, allCodes);
            //GetKLineDataSteps_Day(steps, 20170720, allCodes);
            //GetKLineDataSteps_Day(steps, 20170721, allCodes);


            //更新主力合约信息
            Step_MainFutures step_MainFutures = new Step_MainFutures(this.dataUpdateHelper);

            steps.Add(step_MainFutures);
            ///*
            // * 在准备更新的时候会将所有更新信息索引一次
            // * 所以在准备完更新后保存一次
            // */
            //updatedDataInfo.Save();
            return(steps);
        }