code: def __reduceCurrentPosition(self, quantity, price):
      # Check that we're closing or reducing partially
      assert (
          self.__instrumentTraits.roundQuantity(
              abs(self.__position) - abs(quantity)
          )
          >= 0
      )
      pnl = (price - self.__avgPrice) * quantity * -1
  
      self.__pnl += pnl
      self.__position = self.__instrumentTraits.roundQuantity(
          self.__position + quantity
      )
      if self.__position == 0:
          self.__avgPrice = 0.0
  
imports: import math
  from pyalgotrade import stratanalyzer
  from pyalgotrade import observer
  from pyalgotrade import dataseries
label_desc: Use image node_id 10 for calling the PositionTracker obj's underlying member method code with example usage: obj.__reduceCurrentPosition(quantity, price) without return types