Exemple #1
0
        private void GetTickSteps(List <IStep> steps, List <CodeInfo> codes, UpdatedDataInfo updatedDataInfo)
        {
            for (int i = 0; i < codes.Count; i++)
            {
                CodeInfo   codeInfo = codes[i];
                string     code     = codeInfo.Code;
                List <int> notUpdatedTradingDays;

                ITradingDayReader tradingDayReader = dataUpdateHelper.GetAllTradingDayReader();
                int lastUpdatedTickDate            = updatedDataInfo.GetLastUpdatedTickData(code);
                if (!updateFillUp && lastUpdatedTickDate >= 0)
                {
                    int endDate;
                    if (codeInfo.End <= 0)
                    {
                        endDate = tradingDayReader.LastTradingDay;
                    }
                    else if (codeInfo.End < tradingDayReader.LastTradingDay)
                    {
                        endDate = codeInfo.End;
                    }
                    else
                    {
                        endDate = tradingDayReader.LastTradingDay;
                    }

                    if (lastUpdatedTickDate >= endDate)
                    {
                        continue;
                    }
                    int startDate = tradingDayReader.GetNextTradingDay(lastUpdatedTickDate);
                    if (startDate < 0)
                    {
                        continue;
                    }
                    IList <int> days = tradingDayReader.GetTradingDays(startDate, endDate);
                    if (days.Count == 0)
                    {
                        continue;
                    }
                    notUpdatedTradingDays = new List <int>(days);
                }
                else
                {
                    notUpdatedTradingDays = dataUpdateHelper.GetNotUpdateTradingDays_TickData(code, updateFillUp);
                    if (notUpdatedTradingDays == null || notUpdatedTradingDays.Count == 0)
                    {
                        //updatedDataInfo.WriteUpdateInfo_Tick(code, tradingDayReader.LastTradingDay);
                        continue;
                    }

                    int startDate      = notUpdatedTradingDays[0];
                    int lastUpdateDate = tradingDayReader.GetPrevTradingDay(startDate);
                    //updatedDataInfo.WriteUpdateInfo_Tick(code, lastUpdateDate);
                }
                GetTickSteps(steps, codeInfo, notUpdatedTradingDays, updatedDataInfo);
            }
        }
Exemple #2
0
        public void TestGetNotUpdateTradingDays()
        {
            //DataUpdateHelper dataUpdateHelper = GetDataUpdateHelper(DataUpdateConst.SRCDATAPATH_JINSHUYUAN);
            //List<int> tradingDays = dataUpdateHelper.GetNotUpdateTradingDays_TickData("au1611", true);
            ////AssertUtils.PrintLineList(tradingDays);
            //tradingDays = dataUpdateHelper.GetNotUpdateTradingDays_KLineData("au1611", true);
            //AssertUtils.PrintLineList(tradingDays);

            DataUpdateHelper dataUpdateHelper = GetDataUpdateHelper_BiaoPuYongHua();
            List <int>       tradingDays      = dataUpdateHelper.GetNotUpdateTradingDays_TickData("au1611", true);

            AssertUtils.PrintLineList(tradingDays);
            //tradingDays = dataUpdateHelper.GetNotUpdateTradingDays_KLineData("au1611", true);
            //AssertUtils.PrintLineList(tradingDays);
            //List<int> tradingDays = dataUpdateHelper.GetAllTradingDayReader().GetAllTradingDays();
            //AssertUtils.PrintLineList(tradingDays);

            //List<CodeInfo> codes = dataUpdateHelper.GetNewCodes();
            //AssertUtils.PrintLineList(codes);
        }