class_docstr: Motivation:
  - This class provides an interface for user to read orders from csv files.
class_docstr_tok: ["Motivation",":","-","This","class","provides","an","interface","for","user","to","read","orders","from","csv","files","."]
docstr: Parameters
  ----------
  file : Union[IO, str, Path, pd.DataFrame]
      this parameters will specify the info of expected orders
  
      Here is an example of the content
  
      1) Amount (**adjusted**) based strategy
  
          datetime,instrument,amount,direction
          20200102,  SH600519,  1000,     sell
          20200103,  SH600519,  1000,      buy
          20200106,  SH600519,  1000,     sell
  
  trade_range : Tuple[int, int]
      the intra day time index range of the orders
      the left and right is closed.
  
      If you want to get the trade_range in intra-day
      - `qlib/utils/time.py:def get_day_min_idx_range` can help you create the index range easier
      # TODO: this is a trade_range level limitation. We'll implement a more detailed limitation later.
docstr_tok: ["Parameters","--","--","--","--","--","file",":","Union","[","IO",",","str",",","Path",",","pd.DataFrame","]","this","parameters","will","specify","the","info","of","expected","orders","Here","is","an","example","of","the","content","1",")","Amount","(","*","*","adjusted","*","*",")","based","strategy","datetime",",","instrument",",","amount",",","direction","20200102",",","SH600519",",","1000",",","sell","20200103",",","SH600519",",","1000",",","buy","20200106",",","SH600519",",","1000",",","sell","trade_range",":","Tuple","[","int",",","int","]","the","intra","day","time","index","range","of","the","orders","the","left","and","right","is","closed",".","If","you","want","to","get","the","trade_range","in","intra-day","-","`","qlib\/utils\/time.py",":","def","get_day_min_idx_range","`","can","help","you","create","the","index","range","easier","#","TODO",":","this","is","a","trade_range","level","limitation",".","We","'ll","implement","a","more","detailed","limitation","later","."]
code: def __init__(
      self,
      file: Union[IO, str, Path, pd.DataFrame],
      trade_range: Union[Tuple[int, int], TradeRange] = None,
      *args,
      **kwargs,
  ):
      """
  
      Parameters
      ----------
      file : Union[IO, str, Path, pd.DataFrame]
          this parameters will specify the info of expected orders
  
          Here is an example of the content
  
          1) Amount (**adjusted**) based strategy
  
              datetime,instrument,amount,direction
              20200102,  SH600519,  1000,     sell
              20200103,  SH600519,  1000,      buy
              20200106,  SH600519,  1000,     sell
  
      trade_range : Tuple[int, int]
          the intra day time index range of the orders
          the left and right is closed.
  
          If you want to get the trade_range in intra-day
          - `qlib/utils/time.py:def get_day_min_idx_range` can help you create the index range easier
          # TODO: this is a trade_range level limitation. We'll implement a more detailed limitation later.
  
      """
      super().__init__(*args, **kwargs)
      if isinstance(file, pd.DataFrame):
          self.order_df = file
      else:
          with get_io_object(file) as f:
              self.order_df = pd.read_csv(f, dtype={"datetime": str})
  
      self.order_df["datetime"] = self.order_df["datetime"].apply(
          pd.Timestamp
      )
      self.order_df = self.order_df.set_index(
          ["datetime", "instrument"]
      )
  
      # make sure the datetime is the first level for fast indexing
      self.order_df = lazy_sort_index(
          convert_index_format(self.order_df, level="datetime")
      )
      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 FileOrderStrategy object from inherited base classes: BaseStrategy with example: obj = FileOrderStrategy(file, trade_range)