示例#1
0
 public IKLineDataTradingTimeInfo_Periods GetTradingPeriodsByBarPos(int barPos)
 {
     for (int i = 0; i < timeInfo_DayList.Count; i++)
     {
         IKLineDataTradingTimeInfo_Day timeInfo_Day = timeInfo_DayList[i];
         if (timeInfo_Day.StartPos <= barPos && timeInfo_Day.EndPos >= barPos)
         {
             return(timeInfo_Day.FindPeriods(barPos));
         }
     }
     return(null);
 }
示例#2
0
 /// <summary>
 /// 得到所有交易日结束的barpos
 /// </summary>
 /// <returns></returns>
 public IList <int> GetAllTradingDayEndBarPoses()
 {
     if (tradingDayEndBarPoses == null)
     {
         tradingDayEndBarPoses = new List <int>(this.klineTimeInfo.TradingDayInfos.Count);
         for (int i = 0; i < this.klineTimeInfo.TradingDayInfos.Count; i++)
         {
             IKLineDataTradingTimeInfo_Day timeInfo_Day = this.klineTimeInfo.TradingDayInfos[i];
             tradingDayEndBarPoses.Add(timeInfo_Day.EndPos);
         }
     }
     return(tradingDayEndBarPoses);
 }
示例#3
0
 /// <summary>
 /// 得到所有交易时间结束的barpos
 /// </summary>
 /// <returns></returns>
 public IList <int> GetAllTradingTimeEndBarPoses()
 {
     if (tradingPeriodEndBarPoses == null)
     {
         tradingPeriodEndBarPoses = new List <int>();
         for (int i = 0; i < klineTimeInfo.TradingDayInfos.Count; i++)
         {
             IKLineDataTradingTimeInfo_Day timeInfo_Day = klineTimeInfo.TradingDayInfos[i];
             for (int j = 0; j < timeInfo_Day.TradingPeriods.Count; j++)
             {
                 tradingPeriodEndBarPoses.Add(timeInfo_Day.TradingPeriods[j].EndPos);
             }
         }
     }
     return(tradingPeriodEndBarPoses);
 }