code: def testDrawDown2(self):
      helper = drawdown.DrawDownHelper()
  
      dt = datetime.datetime.now()
      helper.update(dt, 10, 10)
      self.assertEqual(helper.getMaxDrawDown(), 0)
      self.assertEqual(helper.getCurrentDrawDown(), 0)
      self.assertEqual(helper.getDuration(), datetime.timedelta())
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 5, 5)
      self.assertEqual(helper.getMaxDrawDown(), -0.5)
      self.assertEqual(helper.getCurrentDrawDown(), -0.5)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=1)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 4, 4)
      self.assertEqual(helper.getMaxDrawDown(), -0.6)
      self.assertEqual(helper.getCurrentDrawDown(), -0.6)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=2)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 4, 4)
      self.assertEqual(helper.getMaxDrawDown(), -0.6)
      self.assertEqual(helper.getCurrentDrawDown(), -0.6)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=3)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 5, 5)
      self.assertEqual(helper.getMaxDrawDown(), -0.6)
      self.assertEqual(helper.getCurrentDrawDown(), -0.5)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=4)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 9, 9)
      self.assertEqual(helper.getMaxDrawDown(), -0.6)
      self.assertEqual(helper.getCurrentDrawDown(), -0.1)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=5)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 9.9, 9.9)
      self.assertEqual(helper.getMaxDrawDown(), -0.6)
      self.assertEqual(round(helper.getCurrentDrawDown(), 2), -0.01)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=6)
      )
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 20, 20)
      self.assertEqual(helper.getMaxDrawDown(), 0)
      self.assertEqual(helper.getCurrentDrawDown(), 0)
      self.assertEqual(helper.getDuration(), datetime.timedelta())
  
      dt += datetime.timedelta(minutes=1)
      helper.update(dt, 10, 10)
      self.assertEqual(helper.getMaxDrawDown(), -0.5)
      self.assertEqual(helper.getCurrentDrawDown(), -0.5)
      self.assertEqual(
          helper.getDuration(), datetime.timedelta(minutes=1)
      )
  
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 4 for calling the DDHelperCase obj's underlying member method code with example usage: obj.testDrawDown2() without return types