code: def __testIGE_BrokerImpl(self, quantity):
      initialCash = 42.09 * quantity
      # This testcase is based on an example from Ernie Chan's book:
      # 'Quantitative Trading: How to Build Your Own Algorithmic Trading Business'
      barFeed = yahoofeed.Feed()
      barFeed.addBarsFromCSV(
          "ige", common.get_data_file_path("sharpe-ratio-test-ige.csv")
      )
      strat = strategy_test.TestStrategy(barFeed, initialCash)
      strat.setUseAdjustedValues(True)
      strat.setBrokerOrdersGTC(True)
      stratAnalyzer = drawdown.DrawDown()
      strat.attachAnalyzer(stratAnalyzer)
  
      # Disable volume checks to match book results.
      strat.getBroker().getFillStrategy().setVolumeLimit(None)
  
      # Manually place the order to get it filled on the first bar.
      order = strat.getBroker().createMarketOrder(
          broker.Order.Action.BUY, "ige", quantity, True
      )  # Adj. Close: 42.09
      order.setGoodTillCanceled(True)
      strat.getBroker().submitOrder(order)
      strat.addOrder(
          datetime.datetime(2007, 11, 13),
          strat.getBroker().createMarketOrder,
          broker.Order.Action.SELL,
          "ige",
          quantity,
          True,
      )  # Adj. Close: 127.64
      strat.run()
  
      self.assertTrue(
          round(strat.getBroker().getCash(), 2)
          == initialCash + (127.64 - 42.09) * quantity
      )
      self.assertEqual(strat.orderUpdatedCalls, 6)
      self.assertTrue(
          round(stratAnalyzer.getMaxDrawDown(), 5) == 0.31178
      )
      self.assertTrue(
          stratAnalyzer.getLongestDrawDownDuration()
          == datetime.timedelta(days=623)
      )
  
imports: import datetime
  from .None import common
  from .None import strategy_test
  from pyalgotrade.barfeed import yahoofeed
  from pyalgotrade.barfeed import membf
  from pyalgotrade.stratanalyzer import drawdown
  from pyalgotrade import broker
  from pyalgotrade import bar
label_desc: Use image node_id 2 for calling the AnalyzerTestCase obj's underlying member method code with example usage: obj.__testIGE_BrokerImpl(quantity) without return types