class_docstr: A :class:`pyalgotrade.stratanalyzer.StrategyAnalyzer` that records the profit/loss
  and returns of every completed trade.
  
  .. note::
      This analyzer operates on individual completed trades.
      For example, lets say you start with a $1000 cash, and then you buy 1 share of XYZ
      for $10 and later sell it for $20:
  
          * The trade's profit was $10.
          * The trade's return is 100%, even though your whole portfolio went from $1000 to $1020, a 2% return.
code: def __updateTrades(self, posTracker):
      price = 0  # The price doesn't matter since the position should be closed.
      assert posTracker.getPosition() == 0
      netProfit = posTracker.getPnL(price)
      netReturn = posTracker.getReturn(price)
  
      if netProfit > 0:
          self.__profits.append(netProfit)
          self.__positiveReturns.append(netReturn)
          self.__profitableCommissions.append(
              posTracker.getCommissions()
          )
      elif netProfit < 0:
          self.__losses.append(netProfit)
          self.__negativeReturns.append(netReturn)
          self.__unprofitableCommissions.append(
              posTracker.getCommissions()
          )
      else:
          self.__evenTrades += 1
          self.__evenCommissions.append(posTracker.getCommissions())
  
      self.__all.append(netProfit)
      self.__allReturns.append(netReturn)
      self.__allCommissions.append(posTracker.getCommissions())
  
      posTracker.reset()
  
imports: from pyalgotrade import stratanalyzer
  from pyalgotrade import broker
  from pyalgotrade.stratanalyzer import returns
  import numpy
label_desc: Use image node_id 2 for calling the Trades obj's underlying member method code with example usage: obj.__updateTrades(posTracker) without return types