Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# self.wait_for_order_registration

strategies.strategy.Strategy.wait_for_order_registration(self, order)

  Wait for the order to be registered by the broker

  Parameters:

    order (Order object) – Order object to be registered by the broker.

  Return type:

    Order object

  Example

      >>> # For a market buy order
      >>> order = self.create_order("SPY", 100, "buy")
      >>> self.submit_order(order)
      >>> self.wait_for_order_registration(order)

      >>> # For a limit buy order
      >>> order = self.create_order("SPY", 100, "buy", limit_price=100.00)
      >>> self.submit_order(order)
      >>> self.wait_for_order_registration(order)