docstr: Parameter
  position : Position()
  amount_dict : {stock_id : amount}
  direction : the direction of the deal price for estimating the amount
              # NOTE:
              This function is used for calculating current position value.
              So the default direction is sell.
docstr_tok: ["Parameter","position",":","Position","(",")","amount_dict",":","{","stock_id",":","amount","}","direction",":","the","direction","of","the","deal","price","for","estimating","the","amount","#","NOTE",":","This","function","is","used","for","calculating","current","position","value",".","So","the","default","direction","is","sell","."]
code: def calculate_amount_position_value(
      self,
      amount_dict: dict,
      start_time: pd.Timestamp,
      end_time: pd.Timestamp,
      only_tradable: bool = False,
      direction: OrderDir = OrderDir.SELL,
  ) -> float:
      """Parameter
      position : Position()
      amount_dict : {stock_id : amount}
      direction : the direction of the deal price for estimating the amount
                  # NOTE:
                  This function is used for calculating current position value.
                  So the default direction is sell.
      """
      value = 0
      for stock_id in amount_dict:
          if not only_tradable or (
              not self.check_stock_suspended(
                  stock_id=stock_id,
                  start_time=start_time,
                  end_time=end_time,
              )
              and not self.check_stock_limit(
                  stock_id=stock_id,
                  start_time=start_time,
                  end_time=end_time,
              )
          ):
              value += (
                  self.get_deal_price(
                      stock_id=stock_id,
                      start_time=start_time,
                      end_time=end_time,
                      direction=direction,
                  )
                  * amount_dict[stock_id]
              )
      return value
  
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 19 for calling the Exchange obj's underlying member method code with example usage: obj.calculate_amount_position_value(amount_dict, start_time, end_time, only_tradable, direction) and returns: value