class_docstr: The correctness of the metrics of Account in nested execution depends on the shallow copy of `trade_account` in
  qlib/backtest/executor.py:NestedExecutor
  Different level of executor has different Account object when calculating metrics. But the position object is
  shared cross all the Account object.
docstr: update account at each trading bar step
  
  Parameters
  ----------
  trade_start_time : pd.Timestamp
      closed start time of step
  trade_end_time : pd.Timestamp
      closed end time of step
  trade_exchange : Exchange
      trading exchange, used to update current
  atomic : bool
      whether the trading executor is atomic, which means there is no higher-frequency trading executor inside it
      - if atomic is True, calculate the indicators with trade_info
      - else, aggregate indicators with inner indicators
  outer_trade_decision: BaseTradeDecision
      external trade decision
  trade_info : List[(Order, float, float, float)], optional
      trading information, by default None
      - necessary if atomic is True
      - list of tuple(order, trade_val, trade_cost, trade_price)
  inner_order_indicators : Indicator, optional
      indicators of inner executor, by default None
      - necessary if atomic is False
      - used to aggregate outer indicators
  decision_list: List[Tuple[BaseTradeDecision, pd.Timestamp, pd.Timestamp]] = None,
      The decision list of the inner level: List[Tuple[<decision>, <start_time>, <end_time>]]
      The inner level
  indicator_config : dict, optional
      config of calculating indicators, by default {}
docstr_tok: ["update","account","at","each","trading","bar","step","Parameters","--","--","--","--","--","trade_start_time",":","pd.Timestamp","closed","start","time","of","step","trade_end_time",":","pd.Timestamp","closed","end","time","of","step","trade_exchange",":","Exchange","trading","exchange",",","used","to","update","current","atomic",":","bool","whether","the","trading","executor","is","atomic",",","which","means","there","is","no","higher-frequency","trading","executor","inside","it","-","if","atomic","is","True",",","calculate","the","indicators","with","trade_info","-","else",",","aggregate","indicators","with","inner","indicators","outer_trade_decision",":","BaseTradeDecision","external","trade","decision","trade_info",":","List","[","(","Order",",","float",",","float",",","float",")","]",",","optional","trading","information",",","by","default","None","-","necessary","if","atomic","is","True","-","list","of","tuple","(","order",",","trade_val",",","trade_cost",",","trade_price",")","inner_order_indicators",":","Indicator",",","optional","indicators","of","inner","executor",",","by","default","None","-","necessary","if","atomic","is","False","-","used","to","aggregate","outer","indicators","decision_list",":","List","[","Tuple","[","BaseTradeDecision",",","pd.Timestamp",",","pd.Timestamp","]","]","=","None",",","The","decision","list","of","the","inner","level",":","List","[","Tuple","[","<","decision",">",",","<","start_time",">",",","<","end_time",">","]","]","The","inner","level","indicator_config",":","dict",",","optional","config","of","calculating","indicators",",","by","default","{","}"]
code: def update_bar_end(
      self,
      trade_start_time: pd.Timestamp,
      trade_end_time: pd.Timestamp,
      trade_exchange: Exchange,
      atomic: bool,
      outer_trade_decision: BaseTradeDecision,
      trade_info: list = [],
      inner_order_indicators: List[BaseOrderIndicator] = [],
      decision_list: List[
          Tuple[BaseTradeDecision, pd.Timestamp, pd.Timestamp]
      ] = [],
      indicator_config: dict = {},
  ) -> None:
      """update account at each trading bar step
  
      Parameters
      ----------
      trade_start_time : pd.Timestamp
          closed start time of step
      trade_end_time : pd.Timestamp
          closed end time of step
      trade_exchange : Exchange
          trading exchange, used to update current
      atomic : bool
          whether the trading executor is atomic, which means there is no higher-frequency trading executor inside it
          - if atomic is True, calculate the indicators with trade_info
          - else, aggregate indicators with inner indicators
      outer_trade_decision: BaseTradeDecision
          external trade decision
      trade_info : List[(Order, float, float, float)], optional
          trading information, by default None
          - necessary if atomic is True
          - list of tuple(order, trade_val, trade_cost, trade_price)
      inner_order_indicators : Indicator, optional
          indicators of inner executor, by default None
          - necessary if atomic is False
          - used to aggregate outer indicators
      decision_list: List[Tuple[BaseTradeDecision, pd.Timestamp, pd.Timestamp]] = None,
          The decision list of the inner level: List[Tuple[<decision>, <start_time>, <end_time>]]
          The inner level
      indicator_config : dict, optional
          config of calculating indicators, by default {}
      """
      if atomic is True and trade_info is None:
          raise ValueError("trade_info is necessary in atomic executor")
      elif atomic is False and inner_order_indicators is None:
          raise ValueError(
              "inner_order_indicators is necessary in un-atomic executor"
          )
  
      # update current position and hold bar count in each bar end
      self.update_current_position(
          trade_start_time, trade_end_time, trade_exchange
      )
  
      if self.is_port_metr_enabled():
          # portfolio_metrics is portfolio related analysis
          self.update_portfolio_metrics(
              trade_start_time, trade_end_time
          )
          self.update_hist_positions(trade_start_time)
  
      # update indicator in each bar end
      self.update_indicator(
          trade_start_time=trade_start_time,
          trade_exchange=trade_exchange,
          atomic=atomic,
          outer_trade_decision=outer_trade_decision,
          trade_info=trade_info,
          inner_order_indicators=inner_order_indicators,
          decision_list=decision_list,
          indicator_config=indicator_config,
      )
  
imports: from __future__ import annotations
  import copy
  from typing import Dict, List, Optional, Tuple, cast
  import pandas
  from qlib.utils import init_instance_by_config
  from .decision import BaseTradeDecision, Order
  from .exchange import Exchange
  from .high_performance_ds import BaseOrderIndicator
  from .position import BasePosition
  from .report import Indicator, PortfolioMetrics
label_desc: Use image node_id 14 for calling the Account obj's underlying member method code with example usage: obj.update_bar_end(trade_start_time, trade_end_time, trade_exchange, atomic, outer_trade_decision, trade_info, inner_order_indicators, decision_list, indicator_config) without return types