class_docstr: A broker for handling the execution of orders on multiple exchanges.
  Orders are kept in a virtual order book until they are ready to be executed.
  
  Attributes
  ----------
  unexecuted : `List[Order]`
      The list of orders the broker is waiting to execute, when their
      criteria is satisfied.
  executed : `Dict[str, Order]`
      The dictionary of orders the broker has executed since resetting,
      organized by order id.
  trades : `Dict[str, Trade]`
      The dictionary of trades the broker has executed since resetting,
      organized by order id.
class_docstr_tok: ["A","broker","for","handling","the","execution","of","orders","on","multiple","exchanges",".","Orders","are","kept","in","a","virtual","order","book","until","they","are","ready","to","be","executed",".","Attributes","--","--","--","--","--","unexecuted",":","`","List","[","Order","]","`","The","list","of","orders","the","broker","is","waiting","to","execute",",","when","their","criteria","is","satisfied",".","executed",":","`","Dict","[","str",",","Order","]","`","The","dictionary","of","orders","the","broker","has","executed","since","resetting",",","organized","by","order","id",".","trades",":","`","Dict","[","str",",","Trade","]","`","The","dictionary","of","trades","the","broker","has","executed","since","resetting",",","organized","by","order","id","."]
docstr: Updates the brokers order management system.
  
  The broker will look through the unexecuted orders and if an order
  is ready to be executed the broker will submit it to the executed
  list and execute the order.
  
  Then the broker will find any orders that are active, but expired, and
  proceed to cancel them.
docstr_tok: ["Updates","the","brokers","order","management","system",".","The","broker","will","look","through","the","unexecuted","orders","and","if","an","order","is","ready","to","be","executed","the","broker","will","submit","it","to","the","executed","list","and","execute","the","order",".","Then","the","broker","will","find","any","orders","that","are","active",",","but","expired",",","and","proceed","to","cancel","them","."]
code: def update(self) -> None:
      """Updates the brokers order management system.
  
      The broker will look through the unexecuted orders and if an order
      is ready to be executed the broker will submit it to the executed
      list and execute the order.
  
      Then the broker will find any orders that are active, but expired, and
      proceed to cancel them.
      """
      executed_ids = []
      for order in self.unexecuted:
          if order.is_executable:
              executed_ids.append(order.id)
              self.executed[order.id] = order
  
              order.attach(self)
              order.execute()
  
      for order_id in executed_ids:
          self.unexecuted.remove(self.executed[order_id])
  
      for order in self.unexecuted + list(self.executed.values()):
          if order.is_active and order.is_expired:
              self.cancel(order)
  
file_path: tensortrade/tensortrade/oms/orders/broker.py
imports: from typing import List, Dict
  from collections import OrderedDict
  from tensortrade.core.base import TimeIndexed
  from tensortrade.oms.orders.order import Order, OrderStatus
  from tensortrade.oms.orders.order_listener import OrderListener
label_desc: Use image node_id 4 for calling the Broker obj's underlying member method code with example usage: obj.update() without return types