self.get_orderΒΆ

lumibot.strategies.strategy.Strategy.get_order(self, identifier: str, broker_refresh: bool = True, broker_refresh_ttl_seconds: float = 0.0)

Get a tracked order given an identifier. Check the details of the order including status, etc.

In live trading this refreshes broker order state before returning by default. Use this direct lookup after submitting an order if you need to verify that same order immediately. Some brokers can expose a just-submitted order through direct order lookup before it appears in broad account order-list endpoints.

Returns:

An order objects for the identifier

Return type:

Order or None

Example

>>> # Get the order object for the order id
>>> order = self.get_order(order_id)
>>> # Show the status of the order
>>> self.log_message(order.status)