self.cancel_orders

lumibot.strategies.strategy.Strategy.cancel_orders(self, orders)

Cancel orders in all strategies.

Cancels all open orders provided in any of the running strategies.

Parameters:

orders (list of Order objects.)

Return type:

None

Example

>>> # Create two orders then cancel them
>>> order1 = self.create_order("IBM", 100, "buy")
>>> order2 = self.create_order("AAPL", 100, "buy")
>>> self.submit_orders([order1, order2])
>>>
>>> # Cancel all orders
>>> self.cancel_orders([order1, order2])