code: def testBuyAndSellMultipleEvals(self):
      posTracker = returns.PositionTracker(broker.IntegerTraits())
      posTracker.buy(2, 10)
      self.assertEqual(posTracker.getAvgPrice(), 10)
      self.assertEqual(posTracker.getPnL(), 0)
      self.assertEqual(posTracker.getPnL(price=9), -2)
      self.assertEqual(posTracker.getPnL(price=10), 0)
      self.assertEqual(posTracker.getPnL(price=11), 2)
      self.assertEqual(posTracker.getReturn(10), 0)
  
      self.assertEqual(posTracker.getPnL(price=11), 2)
      self.assertEqual(round(posTracker.getReturn(11), 2), 0.1)
  
      self.assertEqual(posTracker.getPnL(price=20), 20)
      self.assertEqual(posTracker.getReturn(20), 1)
  
      posTracker.sell(1, 11)
      self.assertEqual(posTracker.getAvgPrice(), 10)
      self.assertEqual(posTracker.getPnL(price=11), 2)
      self.assertEqual(posTracker.getReturn(11), 0.1)
  
      posTracker.sell(1, 10)
      self.assertEqual(posTracker.getAvgPrice(), 0)
      self.assertEqual(posTracker.getPnL(), 1)
      self.assertEqual(posTracker.getReturn(11), 0.05)
  
imports: import datetime
  from .None import common
  from .None import strategy_test
  from .None import position_test
  from testcases import test_strategy
  from pyalgotrade.barfeed import yahoofeed
  from pyalgotrade.barfeed import csvfeed
  from pyalgotrade.stratanalyzer import returns
  from pyalgotrade import broker
  from pyalgotrade import marketsession
label_desc: Use image node_id 5 for calling the PosTrackerTestCase obj's underlying member method code with example usage: obj.testBuyAndSellMultipleEvals() without return types