Skip to content

Commit

Permalink
alpacahq#573 close_all_positions should take optional cancel_orders a…
Browse files Browse the repository at this point in the history
…rgument
  • Loading branch information
brucewen05 committed Dec 19, 2023
1 parent f54b5a5 commit e938dbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alpaca_trade_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e938dbd

Please sign in to comment.