class_docstr: A :class:`pyalgotrade.stratanalyzer.StrategyAnalyzer` that calculates
  max. drawdown and longest drawdown duration for the portfolio.
code: def beforeOnBars(self, strat, bars):
      equity = self.calculateEquity(strat)
      self.__currDrawDown.update(bars.getDateTime(), equity, equity)
      self.__longestDDDuration = max(
          self.__longestDDDuration, self.__currDrawDown.getDuration()
      )
      self.__maxDD = min(
          self.__maxDD, self.__currDrawDown.getMaxDrawDown()
      )
  
file_path: pyalgotrade/pyalgotrade/stratanalyzer/drawdown.py
imports: from pyalgotrade import stratanalyzer
  import datetime
label_desc: Use image node_id 3 for calling the DrawDown obj's underlying member method code with example usage: obj.beforeOnBars(strat, bars) without return types