docstr: get the trade unit of amount based on **factor**
  the factor can be given directly or calculated in given time range and stock id.
  `factor` has higher priority than `stock_id`, `start_time` and `end_time`
  Parameters
  ----------
  factor : float
      the adjusted factor
  stock_id : str
      the id of the stock
  start_time :
      the start time of trading range
  end_time :
      the end time of trading range
docstr_tok: ["get","the","trade","unit","of","amount","based","on","*","*","factor","*","*","the","factor","can","be","given","directly","or","calculated","in","given","time","range","and","stock","id",".","`","factor","`","has","higher","priority","than","`","stock_id","`",",","`","start_time","`","and","`","end_time","`","Parameters","--","--","--","--","--","factor",":","float","the","adjusted","factor","stock_id",":","str","the","id","of","the","stock","start_time",":","the","start","time","of","trading","range","end_time",":","the","end","time","of","trading","range"]
code: def get_amount_of_trade_unit(
      self,
      factor: float | None = None,
      stock_id: str | None = None,
      start_time: pd.Timestamp = None,
      end_time: pd.Timestamp = None,
  ) -> Optional[float]:
      """
      get the trade unit of amount based on **factor**
      the factor can be given directly or calculated in given time range and stock id.
      `factor` has higher priority than `stock_id`, `start_time` and `end_time`
      Parameters
      ----------
      factor : float
          the adjusted factor
      stock_id : str
          the id of the stock
      start_time :
          the start time of trading range
      end_time :
          the end time of trading range
      """
      if not self.trade_w_adj_price and self.trade_unit is not None:
          factor = self._get_factor_or_raise_error(
              factor=factor,
              stock_id=stock_id,
              start_time=start_time,
              end_time=end_time,
          )
          return self.trade_unit / factor
      else:
          return None
  
imports: from __future__ import annotations
  from collections import defaultdict
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union, cast
  from ..utils.index_data import IndexData
  import random
  import numpy
  import pandas
  from qlib.backtest.position import BasePosition
  from ..config import C
  from ..constant import REG_CN, REG_TW
  from ..data.data import D
  from ..log import get_module_logger
  from .decision import Order, OrderDir, OrderHelper
  from .high_performance_ds import BaseQuote, NumpyQuote
label_desc: Use image node_id 21 for calling the Exchange obj's underlying member method code with example usage: obj.get_amount_of_trade_unit(factor, stock_id, start_time, end_time) and returns: unknown, None