class_docstr: OnlineStrategy is working with `Online Manager <#Online Manager>`_, responding to how the tasks are generated, the models are updated and signals are prepared.
class_docstr_tok: ["OnlineStrategy","is","working","with","`","Online","Manager","<","#","Online","Manager",">","`","_",",","responding","to","how","the","tasks","are","generated",",","the","models","are","updated","and","signals","are","prepared","."]
docstr: Init OnlineStrategy.
  This module **MUST** use `Trainer <../reference/api.html#qlib.model.trainer.Trainer>`_ to finishing model training.
  
  Args:
      name_id (str): a unique name or id.
      trainer (qlib.model.trainer.Trainer, optional): a instance of Trainer. Defaults to None.
docstr_tok: ["Init","OnlineStrategy",".","This","module","*","*","MUST","*","*","use","`","Trainer","<","..","\/reference\/api.html","#","qlib.model.trainer.Trainer",">","`","_","to","finishing","model","training",".","Args",":","name_id","(","str",")",":","a","unique","name","or","id",".","trainer","(","qlib.model.trainer.Trainer",",","optional",")",":","a","instance","of","Trainer",".","Defaults","to","None","."]
code: def __init__(self, name_id: str):
      """
      Init OnlineStrategy.
      This module **MUST** use `Trainer <../reference/api.html#qlib.model.trainer.Trainer>`_ to finishing model training.
  
      Args:
          name_id (str): a unique name or id.
          trainer (qlib.model.trainer.Trainer, optional): a instance of Trainer. Defaults to None.
      """
      self.name_id = name_id
      self.logger = get_module_logger(self.__class__.__name__)
      self.tool = OnlineTool()
  
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 OnlineStrategy object  with example: obj = OnlineStrategy(name_id)