code: def testSeparateAndCombined(self):
      posA = returns.PositionTracker(broker.IntegerTraits())
      posA.buy(11, 10)
      posA.sell(11, 30)
      self.assertEqual(posA.getPnL(), 20 * 11)
      self.assertEqual(posA.getReturn(), 2)
  
      posB = returns.PositionTracker(broker.IntegerTraits())
      posB.sell(100, 1.1)
      posB.buy(100, 1)
      self.assertEqual(round(posB.getPnL(), 2), 100 * 0.1)
      self.assertEqual(round(posB.getReturn(), 2), 0.09)
  
      combinedPos = returns.PositionTracker(broker.IntegerTraits())
      combinedPos.buy(11, 10)
      combinedPos.sell(11, 30)
      combinedPos.sell(100, 1.1)
      combinedPos.buy(100, 1)
      self.assertEqual(round(combinedPos.getReturn(), 6), 2.090909)
      # The return of the combined position is less than the two returns combined
      # because when the second position gets opened the amount of cash not invested is greater
      # than that of posB alone.
      self.assertLess(
          round(combinedPos.getReturn(), 6),
          ((1 + posA.getReturn()) * (1 + posB.getReturn()) - 1),
      )
  
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 11 for calling the PosTrackerTestCase obj's underlying member method code with example usage: obj.testSeparateAndCombined() without return types