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 __init__(self):
      super(Trades, self).__init__()
      self.__all = []
      self.__profits = []
      self.__losses = []
      self.__allReturns = []
      self.__positiveReturns = []
      self.__negativeReturns = []
      self.__allCommissions = []
      self.__profitableCommissions = []
      self.__unprofitableCommissions = []
      self.__evenCommissions = []
      self.__evenTrades = 0
      self.__posTrackers = {}
  
imports: from pyalgotrade import stratanalyzer
  from pyalgotrade import broker
  from pyalgotrade.stratanalyzer import returns
  import numpy
label_desc: Use image node_id 1 to create a new Trades object from inherited base classes: stratanalyzer with example: obj = Trades()