class_docstr: :Usage:
      Instantiate RiskMetricsCumulative once.
      Call update() method on each dt to update the metrics.
class_docstr_tok: [":","Usage",":","Instantiate","RiskMetricsCumulative","once",".","Call","update","(",")","method","on","each","dt","to","update","the","metrics","."]
code: def calculate_max_leverage(self):
      # The leverage is defined as: the gross_exposure/net_liquidation
      # gross_exposure = long_exposure + abs(short_exposure)
      # net_liquidation = ending_cash + long_exposure + short_exposure
      cur_leverage = self.algorithm_cumulative_leverages_cont[
          self.latest_dt_loc
      ]
  
      return max(cur_leverage, self.max_leverage)
  
file_path: catalyst/catalyst/finance/risk/cumulative.py
imports: import functools
  import logbook
  import numpy
  import pandas
  from pandas.tseries.tools import normalize_date
  from six import iteritems
  from .risk import check_entry, choose_treasury
  from catalyst.patches.stats import alpha_beta_aligned, annual_volatility, downside_risk, information_ratio, max_drawdown, sharpe_ratio, sortino_ratio, cum_returns
  import warnings
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 6 for calling the RiskMetricsCumulative obj's underlying member method code with example usage: obj.calculate_max_leverage() and returns: max