示例#1
0
        private static void ForwardNextDay_KLine(DataForForward_Code forwardData, IKLineData_RealTime klineData, KLinePeriod period)
        {
            ITickBar tickBar    = forwardData.CurrentTickData.GetCurrentBar();
            int      nextbarPos = klineData.BarPos + 1;

            //TODO 这样nextday算法还是不够准确
            while (!klineData.IsDayStart(nextbarPos))
            {
                nextbarPos = klineData.BarPos + 1;
            }
            klineData.ChangeCurrentBar(GetKLineBar(tickBar), nextbarPos);
        }
示例#2
0
        private void DealTimeInfo()
        {
            if (mainKLineData.IsTradingTimeStart(mainKLineData.BarPos))
            {
                isTradingTimeStart = true;
            }
            else
            {
                isTradingTimeStart = false;
            }

            if (mainKLineData.IsTradingTimeEnd(mainKLineData.BarPos))
            {
                isTradingTimeEnd = true;
            }
            else
            {
                isTradingTimeEnd = false;
            }

            if (mainKLineData.IsDayStart(mainKLineData.BarPos))
            {
                isDayStart = true;
            }
            else
            {
                isDayStart = false;
            }

            if (mainKLineData.IsDayEnd(mainKLineData.BarPos))
            {
                isDayEnd = true;
            }
            else
            {
                isDayEnd = false;
            }
        }