code: def avg_gain_loss(values, begin, end):
      rangeLen = end - begin
      if rangeLen < 2:
          return None
  
      gain = 0
      loss = 0
      for i in xrange(begin + 1, end):
          currGain, currLoss = gain_loss_one(values[i - 1], values[i])
          gain += currGain
          loss += currLoss
      return (gain / float(rangeLen - 1), loss / float(rangeLen - 1))
  
file_path: pyalgotrade/pyalgotrade/technical/rsi.py
imports: from six.moves import xrange
  from pyalgotrade import technical
label_desc: Use image node_id 2 for calling a global function with example usage: avg_gain_loss(values, begin, end) and returns: unknown,  unknown, None