class_docstr: This example strategy always uses the latest rolling model sas online models.
class_docstr_tok: ["This","example","strategy","always","uses","the","latest","rolling","model","sas","online","models","."]
docstr: Init RollingStrategy.
  
  Assumption: the str of name_id, the experiment name, and the trainer's experiment name are the same.
  
  Args:
      name_id (str): a unique name or id. Will be also the name of the Experiment.
      task_template (Union[dict, List[dict]]): a list of task_template or a single template, which will be used to generate many tasks using rolling_gen.
      rolling_gen (RollingGen): an instance of RollingGen
docstr_tok: ["Init","RollingStrategy",".","Assumption",":","the","str","of","name_id",",","the","experiment","name",",","and","the","trainer","'s","experiment","name","are","the","same",".","Args",":","name_id","(","str",")",":","a","unique","name","or","id",".","Will","be","also","the","name","of","the","Experiment",".","task_template","(","Union","[","dict",",","List","[","dict","]","]",")",":","a","list","of","task_template","or","a","single","template",",","which","will","be","used","to","generate","many","tasks","using","rolling_gen",".","rolling_gen","(","RollingGen",")",":","an","instance","of","RollingGen"]
code: def __init__(
      self,
      name_id: str,
      task_template: Union[dict, List[dict]],
      rolling_gen: RollingGen,
  ):
      """
      Init RollingStrategy.
  
      Assumption: the str of name_id, the experiment name, and the trainer's experiment name are the same.
  
      Args:
          name_id (str): a unique name or id. Will be also the name of the Experiment.
          task_template (Union[dict, List[dict]]): a list of task_template or a single template, which will be used to generate many tasks using rolling_gen.
          rolling_gen (RollingGen): an instance of RollingGen
      """
      super().__init__(name_id=name_id)
      self.exp_name = self.name_id
      if not isinstance(task_template, list):
          task_template = [task_template]
      self.task_template = task_template
      self.rg = rolling_gen
      assert issubclass(
          self.rg.__class__, RollingGen
      ), "The rolling strategy relies on the feature if RollingGen"
      self.tool = OnlineToolR(self.exp_name)
      self.ta = TimeAdjuster()
  
imports: from typing import List, Union
  from qlib.log import get_module_logger
  from qlib.model.ens.group import RollingGroup
  from qlib.utils import transform_end_date
  from qlib.workflow.online.utils import OnlineTool, OnlineToolR
  from qlib.workflow.recorder import Recorder
  from qlib.workflow.task.collect import Collector, RecorderCollector
  from qlib.workflow.task.gen import RollingGen, task_generator
  from qlib.workflow.task.utils import TimeAdjuster
label_desc: Use image node_id 1 to create a new RollingStrategy object from inherited base classes: OnlineStrategy with example: obj = RollingStrategy(name_id, task_template, rolling_gen)