code: def __extendCurrentPosition(self, quantity, price):
      newPosition = self.__instrumentTraits.roundQuantity(
          self.__position + quantity
      )
      self.__avgPrice = (
          self.__avgPrice * abs(self.__position) + price * abs(quantity)
      ) / abs(float(newPosition))
      self.__position = newPosition
      self.__totalCommited = self.__avgPrice * abs(self.__position)
  
imports: import math
  from pyalgotrade import stratanalyzer
  from pyalgotrade import observer
  from pyalgotrade import dataseries
label_desc: Use image node_id 9 for calling the PositionTracker obj's underlying member method code with example usage: obj.__extendCurrentPosition(quantity, price) without return types