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 __init__(
      self,
      sim_params,
      treasury_curves,
      trading_calendar,
      create_first_day_stats=False,
  ):
      self.treasury_curves = treasury_curves
      self.trading_calendar = trading_calendar
      self.start_session = sim_params.start_session
      self.end_session = sim_params.end_session
  
      self.sessions = trading_calendar.sessions_in_range(
          self.start_session, self.end_session
      )
  
      # Hold on to the trading day before the start,
      # used for index of the zero return value when forcing returns
      # on the first day.
      self.day_before_start = self.start_session - self.sessions.freq
  
      last_day = normalize_date(sim_params.end_session)
      if last_day not in self.sessions:
          last_day = pd.tseries.index.DatetimeIndex([last_day])
          self.sessions = self.sessions.append(last_day)
  
      self.sim_params = sim_params
  
      self.create_first_day_stats = create_first_day_stats
  
      cont_index = self.sessions
  
      self.cont_index = cont_index
      self.cont_len = len(self.cont_index)
  
      empty_cont = np.full(self.cont_len, np.nan)
  
      self.algorithm_returns_cont = empty_cont.copy()
      self.benchmark_returns_cont = empty_cont.copy()
      self.algorithm_cumulative_leverages_cont = empty_cont.copy()
      self.mean_returns_cont = empty_cont.copy()
      self.annualized_mean_returns_cont = empty_cont.copy()
      self.mean_benchmark_returns_cont = empty_cont.copy()
      self.annualized_mean_benchmark_returns_cont = empty_cont.copy()
  
      # The returns at a given time are read and reset from the respective
      # returns container.
      self.algorithm_returns = None
      self.benchmark_returns = None
      self.mean_returns = None
      self.annualized_mean_returns = None
      self.mean_benchmark_returns = None
      self.annualized_mean_benchmark_returns = None
  
      self.algorithm_cumulative_returns = empty_cont.copy()
      self.benchmark_cumulative_returns = empty_cont.copy()
      self.algorithm_cumulative_leverages = empty_cont.copy()
      self.excess_returns = empty_cont.copy()
  
      self.latest_dt_loc = 0
      self.latest_dt = cont_index[0]
  
      self.benchmark_volatility = empty_cont.copy()
      self.algorithm_volatility = empty_cont.copy()
      self.beta = empty_cont.copy()
      self.alpha = empty_cont.copy()
      self.sharpe = empty_cont.copy()
      self.downside_risk = empty_cont.copy()
      self.sortino = empty_cont.copy()
      self.information = empty_cont.copy()
  
      self.drawdowns = empty_cont.copy()
      self.max_drawdowns = empty_cont.copy()
      self.max_drawdown = 0
      self.max_leverages = empty_cont.copy()
      self.max_leverage = 0
      self.current_max = -np.inf
      self.daily_treasury = pd.Series(index=self.sessions)
      self.treasury_period_return = np.nan
  
      self.num_trading_days = 0
  
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 1 to create a new RiskMetricsCumulative object from inherited base classes: object with example: obj = RiskMetricsCumulative(sim_params, treasury_curves, trading_calendar, create_first_day_stats)