class_docstr: Tracks the performance of the algorithm.
docstr: When the simulation is complete, run the full period risk report
  and send it out on the results socket.
docstr_tok: ["When","the","simulation","is","complete",",","run","the","full","period","risk","report","and","send","it","out","on","the","results","socket","."]
code: def handle_simulation_end(self):
      """
      When the simulation is complete, run the full period risk report
      and send it out on the results socket.
      """
      if self.sim_params.arena == "backtest":
          log_msg = "Simulated {n} trading days out of {m}."
          log.info(
              log_msg.format(
                  n=int(self.session_count), m=self.total_session_count
              )
          )
          log.info(
              "first open: {d}".format(d=self.sim_params.first_open)
          )
          log.info(
              "last close: {d}".format(d=self.sim_params.last_close)
          )
  
      bms = pd.Series(
          index=self.cumulative_risk_metrics.cont_index,
          data=self.cumulative_risk_metrics.benchmark_returns_cont,
      )
      ars = pd.Series(
          index=self.cumulative_risk_metrics.cont_index,
          data=self.cumulative_risk_metrics.algorithm_returns_cont,
      )
      acl = self.cumulative_risk_metrics.algorithm_cumulative_leverages
  
      risk_report = risk.RiskReport(
          ars,
          self.sim_params,
          benchmark_returns=bms,
          algorithm_leverages=acl,
          trading_calendar=self.trading_calendar,
          treasury_curves=self.treasury_curves,
      )
  
      return risk_report.to_dict()
  
imports: from __future__ import division
  import logbook
  import pandas
  from pandas.tseries.tools import normalize_date
  from catalyst.finance.performance.period import PerformancePeriod
  from catalyst.errors import NoFurtherDataError
  import catalyst.finance.risk
  from .position_tracker import PositionTracker
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 20 for calling the PerformanceTracker obj's underlying member method code with example usage: obj.handle_simulation_end() and returns: risk_report