docstr: Return the PnL that would result if closing the position a the given price.
  Note that this will be different if commissions are used when the trade is executed.
code: def getPnL(self, price=None, includeCommissions=True):
      """
      Return the PnL that would result if closing the position a the given price.
      Note that this will be different if commissions are used when the trade is executed.
      """
  
      ret = self.__pnl
      if price:
          ret += (price - self.__avgPrice) * self.__position
      if includeCommissions:
          ret -= self.__commissions
      return ret
  
imports: import math
  from pyalgotrade import stratanalyzer
  from pyalgotrade import observer
  from pyalgotrade import dataseries
label_desc: Use image node_id 6 for calling the PositionTracker obj's underlying member method code with example usage: obj.getPnL(price, includeCommissions) and returns: ret