docstr: Parameters
  -----------
  signal :
      the information to describe a signal. Please refer to the docs of `qlib.backtest.signal.create_signal_from`
      the decision of the strategy will base on the given signal
  risk_degree : float
      position percentage of total value.
  trade_exchange : Exchange
      exchange that provides market info, used to deal order and generate report
      - If `trade_exchange` is None, self.trade_exchange will be set with common_infra
      - It allowes different trade_exchanges is used in different executions.
      - For example:
          - In daily execution, both daily exchange and minutely are usable, but the daily exchange is recommended because it runs faster.
          - In minutely execution, the daily exchange is not usable, only the minutely exchange is recommended.
docstr_tok: ["Parameters","--","--","--","--","--","-","signal",":","the","information","to","describe","a","signal",".","Please","refer","to","the","docs","of","`","qlib.backtest.signal.create_signal_from","`","the","decision","of","the","strategy","will","base","on","the","given","signal","risk_degree",":","float","position","percentage","of","total","value",".","trade_exchange",":","Exchange","exchange","that","provides","market","info",",","used","to","deal","order","and","generate","report","-","If","`","trade_exchange","`","is","None",",","self.trade_exchange","will","be","set","with","common_infra","-","It","allowes","different","trade_exchanges","is","used","in","different","executions",".","-","For","example",":","-","In","daily","execution",",","both","daily","exchange","and","minutely","are","usable",",","but","the","daily","exchange","is","recommended","because","it","runs","faster",".","-","In","minutely","execution",",","the","daily","exchange","is","not","usable",",","only","the","minutely","exchange","is","recommended","."]
code: def __init__(
      self,
      *,
      signal: Union[
          Signal,
          Tuple[BaseModel, Dataset],
          List,
          Dict,
          Text,
          pd.Series,
          pd.DataFrame,
      ] = None,
      model=None,
      dataset=None,
      risk_degree: float = 0.95,
      trade_exchange=None,
      level_infra=None,
      common_infra=None,
      **kwargs,
  ):
      """
      Parameters
      -----------
      signal :
          the information to describe a signal. Please refer to the docs of `qlib.backtest.signal.create_signal_from`
          the decision of the strategy will base on the given signal
      risk_degree : float
          position percentage of total value.
      trade_exchange : Exchange
          exchange that provides market info, used to deal order and generate report
          - If `trade_exchange` is None, self.trade_exchange will be set with common_infra
          - It allowes different trade_exchanges is used in different executions.
          - For example:
              - In daily execution, both daily exchange and minutely are usable, but the daily exchange is recommended because it runs faster.
              - In minutely execution, the daily exchange is not usable, only the minutely exchange is recommended.
  
      """
      super().__init__(
          level_infra=level_infra,
          common_infra=common_infra,
          trade_exchange=trade_exchange,
          **kwargs,
      )
  
      self.risk_degree = risk_degree
  
      # This is trying to be compatible with previous version of qlib task config
      if model is not None and dataset is not None:
          warnings.warn(
              "`model` `dataset` is deprecated; use `signal`.",
              DeprecationWarning,
          )
          signal = model, dataset
  
      self.signal: Signal = create_signal_from(signal)
  
imports: import os
  import copy
  import warnings
  import numpy
  import pandas
  from typing import Dict, List, Text, Tuple, Union
  from abc import ABC
  from qlib.data import D
  from qlib.data.dataset import Dataset
  from qlib.model.base import BaseModel
  from qlib.strategy.base import BaseStrategy
  from qlib.backtest.position import Position
  from qlib.backtest.signal import Signal, create_signal_from
  from qlib.backtest.decision import Order, OrderDir, TradeDecisionWO
  from qlib.log import get_module_logger
  from qlib.utils import get_pre_trading_date, load_dataset
  from qlib.contrib.strategy.order_generator import OrderGenerator, OrderGenWOInteract
  from qlib.contrib.strategy.optimizer import EnhancedIndexingOptimizer
label_desc: Use image node_id 1 to create a new BaseSignalStrategy object from inherited base classes: BaseStrategy, ABC with example: obj = BaseSignalStrategy()