We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 290ee80 commit 8b5734bCopy full SHA for 8b5734b
alpaca_trade_api/rest.py
@@ -234,6 +234,14 @@ def get_position(self, symbol):
234
resp = self.get('/positions/{}'.format(symbol))
235
return Position(resp)
236
237
+ def close_position(self, symbol):
238
+ '''Liquidates the position for the given symbol at market price'''
239
+ self.delete('/positions/{}'.format(symbol))
240
+
241
+ def close_all_positions(self, symbol):
242
+ '''Liquidates all open positions at market price'''
243
+ self.delete('/positions')
244
245
def list_assets(self, status=None, asset_class=None):
246
'''Get a list of assets'''
247
params = {
0 commit comments