code: def main(self):
      print("========== reset ==========")
      self.reset()
      print("========== simulate ==========")
      self.rolling_online_manager.simulate(end_time=self.end_time)
      print("========== collect results ==========")
      print(self.rolling_online_manager.get_collector()())
      print("========== signals ==========")
      signals = self.rolling_online_manager.get_signals()
      print(signals)
      # Backtesting
      # - the code is based on this example https://qlib.readthedocs.io/en/latest/component/strategy.html
      CSI300_BENCH = "SH000903"
      STRATEGY_CONFIG = {
          "topk": 30,
          "n_drop": 3,
          "signal": signals.to_frame("score"),
      }
      strategy_obj = TopkDropoutStrategy(**STRATEGY_CONFIG)
      report_normal, positions_normal = backtest_daily(
          start_time=signals.index.get_level_values("datetime").min(),
          end_time=signals.index.get_level_values("datetime").max(),
          strategy=strategy_obj,
      )
      analysis = dict()
      analysis["excess_return_without_cost"] = risk_analysis(
          report_normal["return"] - report_normal["bench"]
      )
      analysis["excess_return_with_cost"] = risk_analysis(
          report_normal["return"]
          - report_normal["bench"]
          - report_normal["cost"]
      )
  
      analysis_df = pd.concat(analysis)  # type: pd.DataFrame
      pprint(analysis_df)
  
file_path: qlib/examples/online_srv/online_management_simulate.py
imports: from pprint import pprint
  import fire
  import qlib
  from qlib.model.trainer import DelayTrainerR, DelayTrainerRM, TrainerR, TrainerRM
  from qlib.workflow import R
  from qlib.workflow.online.manager import OnlineManager
  from qlib.workflow.online.strategy import RollingStrategy
  from qlib.workflow.task.gen import RollingGen
  from qlib.workflow.task.manage import TaskManager
  from qlib.tests.config import CSI100_RECORD_LGB_TASK_CONFIG_ONLINE, CSI100_RECORD_XGBOOST_TASK_CONFIG_ONLINE
  import pandas
  from qlib.contrib.evaluate import backtest_daily
  from qlib.contrib.evaluate import risk_analysis
  from qlib.contrib.strategy import TopkDropoutStrategy
label_desc: Use image node_id 3 for calling the OnlineSimulationExample obj's underlying member method code with example usage: obj.main() without return types