예제 #1
0
        public static IKLineData Transfer(int date, TickData data, TradingDayReader openDateReader, List <double[]> opentime, KLinePeriod targetPeriod, KLineData lastKLineData)
        {
            List <double> klineTimePeriods = OpenTimeUtils.GetKLineTimeList(date, openDateReader, opentime, targetPeriod);
            KLineData     klineData        = new KLineData(klineTimePeriods.Count);

            for (int i = 0; i < klineTimePeriods.Count; i++)
            {
                klineData.arr_time[i] = klineTimePeriods[i];
            }

            int currentTickindex = 0;

            for (int i = 0; i < klineData.Length; i++)
            {
            }

            return(klineData);
        }
예제 #2
0
        private KLineData GetEmptyDayKLineData(string code, int date, List <double[]> openTimes, ITradingDayReader openDateReader, IKLineData lastKLineData)
        {
            float         lastPrice    = lastKLineData.Arr_End[lastKLineData.Length - 1];
            int           lastHold     = lastKLineData.Arr_Hold[lastKLineData.Length - 1];
            List <double> openTimeList = OpenTimeUtils.GetKLineTimeList(date, openDateReader, openTimes, KLinePeriod.KLinePeriod_1Minute);
            KLineData     klineData    = new KLineData(openTimeList.Count);

            for (int i = 0; i < klineData.Length; i++)
            {
                klineData.arr_time[i]  = openTimeList[i];
                klineData.arr_start[i] = lastPrice;
                klineData.arr_high[i]  = lastPrice;
                klineData.arr_low[i]   = lastPrice;
                klineData.arr_end[i]   = lastPrice;
                klineData.arr_mount[i] = 0;
                klineData.arr_money[i] = 0;
                klineData.arr_hold[i]  = lastHold;
            }
            return(klineData);
        }
예제 #3
0
 /// <summary>
 /// 构建函数
 /// </summary>
 /// <param name="date">指定要transfer的日期</param>
 /// <param name="data">要转换的tick数据</param>
 /// <param name="openDateReader">开盘日读取器,传入该接口是为了得到</param>
 /// <param name="opentime"></param>
 /// <param name="targetPeriod"></param>
 /// <param name="lastKLineData"></param>
 public DataTransfer_Tick2KLine2(TickData data, IKLineData lastKLineData, OpenTimeUtilsArgs openTimeUtilsArgs)
 {
     this.tickData      = data;
     this.lastKLineData = lastKLineData;
     this.klineTimes    = OpenTimeUtils.GetKLineTimeList(openTimeUtilsArgs);
 }