Exemplo n.º 1
0
        private void GetKLineDataSteps(List <IStep> steps, CodeInfo codeInfo, List <int> tradingDays, UpdatedDataInfo updatedDataInfo)
        {
            int stepCount           = tradingDays.Count / DAYS_EVERYKLINESTEP;
            int lastStepUpdateCount = tradingDays.Count % DAYS_EVERYKLINESTEP;

            if (lastStepUpdateCount != 0)
            {
                stepCount++;
            }
            else
            {
                lastStepUpdateCount = DAYS_EVERYKLINESTEP;
            }

            List <int> openDates = tradingDays;

            for (int i = 0; i < stepCount; i++)
            {
                Step_KLineData step;
                if (i != stepCount - 1)
                {
                    step = new Step_KLineData(codeInfo, openDates.GetRange(i * DAYS_EVERYKLINESTEP, DAYS_EVERYKLINESTEP), dataUpdateHelper, null, updateFillUp);
                }
                else
                {
                    step = new Step_KLineData(codeInfo, openDates.GetRange(i * DAYS_EVERYKLINESTEP, lastStepUpdateCount), dataUpdateHelper, updatedDataInfo, updateFillUp);
                }
                steps.Add(step);
            }
        }
Exemplo n.º 2
0
 private void GetKLineDataSteps_Day(List <IStep> steps, int tradingDay, List <CodeInfo> allCodes)
 {
     for (int i = 0; i < allCodes.Count; i++)
     {
         CodeInfo codeInfo = allCodes[i];
         if (codeInfo.End == 0 || codeInfo.End >= tradingDay)
         {
             List <int> tradingDays = new List <int>();
             tradingDays.Add(tradingDay);
             Step_KLineData step = new Step_KLineData(codeInfo, tradingDays, true, dataUpdateHelper);
             steps.Add(step);
         }
     }
 }