Please consider making the cancellation of existing orders a default action included in the DELETE positions endpoints. I would expect that if a trader wants to rapidly exit a position at market, they would not want to have to worry about finding and cancelling existing orders. That seems like a backend job.
Currently an error is returned if there are competing open orders, like so:
"message": "insufficient qty available for order (requested: 1000, available: 0)",
That makes sense. It could be additional parameter to do the extra work in backend.
Yes, that would be a great solution.
Seconding this. Close all positions should just close all positions, full stop. I can only see the usefulness of this endpoint being akin to a killswitch, but it doesn’t really serve that purpose if the positions have associated orders. As I’m building AlpacaforR, I’m going to have the function that calls this endpoint cancel all orders first as a workaround but would like to see the endpoint modified such that it does this automatically.
Make sense. It shouldn’t be too hard to add it…
May I know if the feature is added ? How to check if there’s any feature updated ?
It is not added yet. We will let you know.
looking forward to seeing this implemented!