diff --git a/alpaca_trade_api/rest.py b/alpaca_trade_api/rest.py index db010328..60a39c17 100644 --- a/alpaca_trade_api/rest.py +++ b/alpaca_trade_api/rest.py @@ -524,9 +524,9 @@ def close_position(self, symbol: str, *, resp = self.delete('/positions/{}'.format(symbol), data=data) return self.response_wrapper(resp, Position) - def close_all_positions(self) -> Positions: + def close_all_positions(self, cancel_orders: bool=False) -> Positions: """Liquidates all open positions at market price""" - resp = self.delete('/positions') + resp = self.delete('/positions', data={'cancel_orders': cancel_orders}) if self._use_raw_data: return resp else: