self.close_positions¶
- lumibot.strategies.strategy.Strategy.close_positions(self, assets)
Close multiple positions for the specified assets.
Iterates over the provided list of assets and attempts to close each open position. See close_position for details on how each position is closed.
- Parameters:
assets (list[str or Asset]) – Symbols or Asset objects identifying the positions to close.
- Returns:
Results from each close_position call, or None if no action was taken.
- Return type:
list
Notes
For crypto futures (e.g., Bitunix), this will use the broker’s flash close endpoint if available.
For spot/stock/futures brokers, this will submit a market sell order for each open position.