Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# self.sell_all

lumibot.strategies.strategy.Strategy.sell_all(self, cancel_open_orders=True)

  Sell all strategy positions.

  The system will generate closing market orders for each open position. If cancel_open_orders is True, then all open orders will also be cancelled.

  Open orders are cancelled before the positions are closed.

  Parameters

    cancel_open_orders (boolean) – Cancel all order if True, leave all orders in place if False. Default is True.

  Returns

  Return type

    None

  Example

      >>> # Will close all positions for the strategy
      >>> self.sell_all()