Skip to content

Add order cancellation and position liquidation endpoints

Choose a tag to compare

@ttt733 ttt733 released this 31 Jul 23:10
· 639 commits to master since this release

We've added a few new methods to the Alpaca API, described below.

cancel_all_orders(): Cancels all open orders.
close_position(symbol): Closes any open position for the given symbol at market price.
close_all_positions(): Closes all open positions at market price.

Official documentation can be found here:
https://docs.alpaca.markets/api-documentation/api-v2/orders/#cancel-all-orders
https://docs.alpaca.markets/api-documentation/api-v2/positions/#close-all-positions