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 broker after an order has been filled.
  
  Parameters
  ----------
  order : `Order`
      The order that is being filled.
  trade : `Trade`
      The trade that is being made to fill the order.
docstr_tok: ["Updates","the","broker","after","an","order","has","been","filled",".","Parameters","--","--","--","--","--","order",":","`","Order","`","The","order","that","is","being","filled",".","trade",":","`","Trade","`","The","trade","that","is","being","made","to","fill","the","order","."]
code: def on_fill(self, order: "Order", trade: "Trade") -> None:
      """Updates the broker after an order has been filled.
  
      Parameters
      ----------
      order : `Order`
          The order that is being filled.
      trade : `Trade`
          The trade that is being made to fill the order.
      """
      if trade.order_id in self.executed and trade not in self.trades:
          self.trades[trade.order_id] = self.trades.get(
              trade.order_id, []
          )
          self.trades[trade.order_id] += [trade]
  
          if order.is_complete:
              next_order = order.complete()
  
              if next_order:
                  if next_order.is_executable:
                      self.executed[next_order.id] = next_order
  
                      next_order.attach(self)
                      next_order.execute()
                  else:
                      self.submit(next_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 5 for calling the Broker obj's underlying member method code with example usage: obj.on_fill(order, trade) without return types