class_docstr: The algorithm's interface to the registered risk and performance
  metrics.
  
  Parameters
  ----------
  trading_calendar : TrandingCalendar
      The trading calendar used in the simulation.
  first_session : pd.Timestamp
      The label of the first trading session in the simulation.
  last_session : pd.Timestamp
      The label of the last trading session in the simulation.
  capital_base : float
      The starting capital for the simulation.
  emission_rate : {'daily', 'minute'}
      How frequently should a performance packet be generated?
  data_frequency : {'daily', 'minute'}
      The data frequency of the data portal.
  asset_finder : AssetFinder
      The asset finder used in the simulation.
  metrics : list[Metric]
      The metrics to track.
code: def __init__(
      self,
      trading_calendar,
      first_session,
      last_session,
      capital_base,
      emission_rate,
      data_frequency,
      asset_finder,
      metrics,
  ):
      self.emission_rate = emission_rate
  
      self._trading_calendar = trading_calendar
      self._first_session = first_session
      self._last_session = last_session
      self._capital_base = capital_base
      self._asset_finder = asset_finder
  
      self._current_session = first_session
      (
          self._market_open,
          self._market_close,
      ) = self._execution_open_and_close(
          trading_calendar,
          first_session,
      )
      self._session_count = 0
  
      self._sessions = sessions = trading_calendar.sessions_in_range(
          first_session,
          last_session,
      )
      self._total_session_count = len(sessions)
  
      self._ledger = Ledger(sessions, capital_base, data_frequency)
  
      self._benchmark_source = NamedExplodingObject(
          "self._benchmark_source",
          "_benchmark_source is not set until ``handle_start_of_simulation``"
          " is called",
      )
  
      if emission_rate == "minute":
  
          def progress(self):
              return 1.0  # a fake value
  
      else:
  
          def progress(self):
              return self._session_count / self._total_session_count
  
      # don't compare these strings over and over again!
      self._progress = progress
  
      # bind all of the hooks from the passed metric objects.
      for hook in self._hooks:
          registered = []
          for metric in metrics:
              try:
                  registered.append(getattr(metric, hook))
              except AttributeError:
                  pass
  
          def closing_over_loop_variables_is_hard(
              registered=registered,
          ):
              def hook_implementation(*args, **kwargs):
                  for impl in registered:
                      impl(*args, **kwargs)
  
              return hook_implementation
  
          hook_implementation = closing_over_loop_variables_is_hard()
  
          hook_implementation.__name__ = hook
          setattr(self, hook, hook_implementation)
  
imports: from __future__ import division
  import logbook
  from ..ledger import Ledger
  from zipline.utils.exploding_object import NamedExplodingObject
label_desc: Use image node_id 2 to create a new MetricsTracker object from inherited base classes: object with example: obj = MetricsTracker(trading_calendar, first_session, last_session, capital_base, emission_rate, data_frequency, asset_finder, metrics)