code: def testSetSharesWithNoStartingCash(self):
      barFeed = yahoofeed.Feed()
      barFeed.addBarsFromCSV(
          AnalyzerTestCase.TestInstrument,
          common.get_data_file_path("orcl-2001-yahoofinance.csv"),
      )
  
      strat = test_strategy.BacktestingStrategy(barFeed, 0)
  
      initialShares = 2
      initialPrice = 16.25
      strat.getBroker().setShares(
          AnalyzerTestCase.TestInstrument, initialShares, initialPrice
      )
  
      # Close initial position
      closingPrice = 32.50
      strat.scheduleCall(
          datetime.datetime(2001, 1, 4),
          lambda: strat.marketOrder(
              AnalyzerTestCase.TestInstrument, -initialShares
          ),
      )
  
      stratAnalyzer = returns.Returns()
      strat.attachAnalyzer(stratAnalyzer)
      strat.run()
  
      self.assertEqual(
          strat.getBroker().getShares(AnalyzerTestCase.TestInstrument),
          0,
      )
      self.assertEqual(
          strat.getBroker().getCash(), closingPrice * initialShares
      )
  
      # Check period returns.
      expectedPeriodReturns = [
          (26.37 - initialPrice) / initialPrice,
          (32.00 - 26.37) / 26.37,
          (32.56 - 32.00) / 32.00,
          (32.50 - 32.56) / 32.56,
          0,
          # Nothing should change moving forward
          0,
          0,
      ]
      for i, expectedReturn in enumerate(expectedPeriodReturns):
          self.assertEqual(
              stratAnalyzer.getReturns()[i], expectedReturn
          )
      self.assertEqual(
          stratAnalyzer.getReturns()[-1], expectedPeriodReturns[-1]
      )
  
      # Check cumulative returns.
      expectedCumulativeReturns = [
          (26.37 - initialPrice) / initialPrice,
          (32.00 - initialPrice) / initialPrice,
          (32.56 - initialPrice) / initialPrice,
          (32.50 - initialPrice) / initialPrice,
          # Nothing should change moving forward
          (32.50 - initialPrice) / initialPrice,
          (32.50 - initialPrice) / initialPrice,
      ]
      for i, expectedReturn in enumerate(expectedCumulativeReturns):
          self.assertEqual(
              round(stratAnalyzer.getCumulativeReturns()[i], 4),
              round(expectedReturn, 4),
          )
      self.assertEqual(
          round(stratAnalyzer.getCumulativeReturns()[-1], 4),
          round(expectedCumulativeReturns[-1], 4),
      )
  
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 AnalyzerTestCase obj's underlying member method code with example usage: obj.testSetSharesWithNoStartingCash() without return types