parameters: (self, market, code, query)
return_statement: return (start_pos, end_pos)
docstring: 【重载接口】（必须）按日期获取指定的K线数据
          
          :param str market: 市场标识
          :param str code: 证券代码
          :param Query query: 日期查询条件（QueryByDate）
docstring_summary: 【重载接口】（必须）按日期获取指定的K线数据
          
          :param str market: 市场标识
          :param str code: 证券代码
          :param Query query: 日期查询条件（QueryByDate）
docstring_tokens: 【重载接口】（必须）按日期获取指定的K线数据 : param str market : 市场标识 : param str code : 证券代码 : param Query query : 日期查询条件（QueryByDate）
function: def _getIndexRangeByDate(self, market, code, query):
          """
          【重载接口】（必须）按日期获取指定的K线数据
          
          :param str market: 市场标识
          :param str code: 证券代码
          :param Query query: 日期查询条件（QueryByDate）        
          """
          print("getIndexRangeByDate")
  
          if query.query_type != Query.DATE:
              return (0, 0)
  
          start_datetime = query.startDatetime
          end_datetime = query.endDatetime
          if start_datetime >= end_datetime or start_datetime > Datetime.max():
              return (0, 0)
  
          data = self._get_bars(market, code, query.kType)
          total = len(data)
          if total == 0:
              return (0, 0)
  
          mid, low = 0, 0
          high = total - 1
          while low <= high:
              tmp_datetime = Datetime(data.index[high])
              if start_datetime > tmp_datetime:
                  mid = high + 1
                  break
  
              tmp_datetime = Datetime(data.index[low])
              if tmp_datetime >= start_datetime:
                  mid = low
                  break
  
              mid = (low + high) // 2
              tmp_datetime = Datetime(data.index[mid])
              if start_datetime > tmp_datetime:
                  low = mid + 1
              else:
                  high = mid - 1
  
          if mid >= total:
              return (0, 0)
  
          start_pos = mid
          low = mid
          high = total - 1
          while low <= high:
              tmp_datetime = Datetime(data.index[high])
              if end_datetime > tmp_datetime:
                  mid = high + 1
                  break
  
              tmp_datetime = Datetime(data.index[low])
              if tmp_datetime >= end_datetime:
                  mid = low
                  break
  
              mid = (low + high) // 2
              tmp_datetime = Datetime(data.index[mid])
              if end_datetime > tmp_datetime:
                  low = mid + 1
              else:
                  high = mid - 1
  
          end_pos = total if mid >= total else mid
          if start_pos >= end_pos:
              return (0, 0)
  
          return (start_pos, end_pos)
function_tokens: def _getIndexRangeByDate ( self , market , code , query ) : print ( "getIndexRangeByDate" ) if query . query_type != Query . DATE : return ( 0 , 0 ) start_datetime = query . startDatetime end_datetime = query . endDatetime if start_datetime >= end_datetime or start_datetime > Datetime . max ( ) : return ( 0 , 0 ) data = self . _get_bars ( market , code , query . kType ) total = len ( data ) if total == 0 : return ( 0 , 0 ) mid , low = 0 , 0 high = total - 1 while low <= high : tmp_datetime = Datetime ( data . index [ high ] ) if start_datetime > tmp_datetime : mid = high + 1 break tmp_datetime = Datetime ( data . index [ low ] ) if tmp_datetime >= start_datetime : mid = low break mid = ( low + high ) // 2 tmp_datetime = Datetime ( data . index [ mid ] ) if start_datetime > tmp_datetime : low = mid + 1 else : high = mid - 1 if mid >= total : return ( 0 , 0 ) start_pos = mid low = mid high = total - 1 while low <= high : tmp_datetime = Datetime ( data . index [ high ] ) if end_datetime > tmp_datetime : mid = high + 1 break tmp_datetime = Datetime ( data . index [ low ] ) if tmp_datetime >= end_datetime : mid = low break mid = ( low + high ) // 2 tmp_datetime = Datetime ( data . index [ mid ] ) if end_datetime > tmp_datetime : low = mid + 1 else : high = mid - 1 end_pos = total if mid >= total else mid if start_pos >= end_pos : return ( 0 , 0 ) return ( start_pos , end_pos )