docstr: Parameters
  ----------
  trade_range : Tuple
      please refer to the `trade_range` parameter of BaseStrategy
  sample_ratio : float
      the ratio of all orders are sampled
  volume_ratio : float
      the volume of the total day
      raito of the total volume of a specific day
  market : str
      stock pool for sampling
docstr_tok: ["Parameters","--","--","--","--","--","trade_range",":","Tuple","please","refer","to","the","`","trade_range","`","parameter","of","BaseStrategy","sample_ratio",":","float","the","ratio","of","all","orders","are","sampled","volume_ratio",":","float","the","volume","of","the","total","day","raito","of","the","total","volume","of","a","specific","day","market",":","str","stock","pool","for","sampling"]
code: def __init__(
      self,
      trade_range: Union[
          Tuple[int, int], TradeRange
      ],  # The range is closed on both left and right.
      sample_ratio: float = 1.0,
      volume_ratio: float = 0.01,
      market: str = "all",
      direction: int = Order.BUY,
      *args,
      **kwargs,
  ):
      """
      Parameters
      ----------
      trade_range : Tuple
          please refer to the `trade_range` parameter of BaseStrategy
      sample_ratio : float
          the ratio of all orders are sampled
      volume_ratio : float
          the volume of the total day
          raito of the total volume of a specific day
      market : str
          stock pool for sampling
      """
  
      super().__init__(*args, **kwargs)
      self.sample_ratio = sample_ratio
      self.volume_ratio = volume_ratio
      self.market = market
      self.direction = direction
      exch: Exchange = self.common_infra.get("trade_exchange")
      # TODO: this can't be online
      self.volume = D.features(
          D.instruments(market),
          ["Mean(Ref($volume, 1), 10)"],
          start_time=exch.start_time,
          end_time=exch.end_time,
      )
      self.volume_df = self.volume.iloc[:, 0].unstack()
      self.trade_range = trade_range
  
imports: from pathlib import Path
  import warnings
  import numpy
  import pandas
  from typing import IO, List, Tuple, Union
  from qlib.data.dataset.utils import convert_index_format
  from qlib.utils import lazy_sort_index
  from ...utils.resam import resam_ts_data, ts_data_last
  from ...data.data import D
  from ...strategy.base import BaseStrategy
  from ...backtest.decision import BaseTradeDecision, Order, TradeDecisionWO, TradeRange
  from ...backtest.exchange import Exchange, OrderHelper
  from ...backtest.utils import CommonInfrastructure, LevelInfrastructure
  from qlib.utils.file import get_io_object
  from qlib.backtest.utils import get_start_end_idx
label_desc: Use image node_id 1 to create a new RandomOrderStrategy object from inherited base classes: BaseStrategy with example: obj = RandomOrderStrategy(trade_range, sample_ratio, volume_ratio, market, direction)