Closed sshcli closed 1 year ago
Hey @sshcli just to clarify a little when I asked you to open an issue here it was about requesting that the api endpoint itself be updated to have the new query parameter to allow for the functionality, not to come here and ask for changes to the python sdk 😞; sorry about not being more clear on that front.
For clarity for everyone else, this request is to update the Trading api endpoint for deleting all orders (DELETE /v2/orders
) to allow for a new query parameter named side
that allows you to cancel orders only matching that side. IE specifying ?side=buy
will only close out your orders to buy; leaving your sell orders in place.
Thank you @drew887 for your clarification. Regards,
This can be done in the new SDK
GetOrdersRequest(symbols=[symbol], side='buy')
See: https://github.com/alpacahq/alpaca-py/issues/140
I'm closing this one
Is your feature request related to a problem? Please describe. According to de documentation here: https://alpaca.markets/docs/api-references/trading-api/orders/
You can only cancel all orders, there is no parameters to specify the side you want to cancel. (Buy or Sell)
The following optional params does not work here:
Describe the solution you'd like We need an easy way to cancel all orders filtered by the side (Cancel all buy orders or cancel or sell orders)
We need something like these:
Describe alternatives you've considered As a workaround you could try to perform this task by adding extra Python code to your program. But IMHO, simple is better than complex
Additional context In response to the request made here https://github.com/alpacahq/alpaca-trade-api-python/issues/611