Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close all orders if one fails #1369

Open
ahmedzzabdalla0 opened this issue Nov 1, 2023 · 1 comment
Open

Close all orders if one fails #1369

ahmedzzabdalla0 opened this issue Nov 1, 2023 · 1 comment

Comments

@ahmedzzabdalla0
Copy link

If I am going to request a group of orders and an error occurs in one of them, I want it to stop and delete any previous order that was executed.
I'm wondering if there is an official way on Binance to do this

Instead of using try and except then delete one by one, an error may also occur due to deletion

@dhyanKaro
Copy link

You can make a wrapper function which records the order id of each order placed if it was successful or not, then if it wasn't, break and start cancelling them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@dhyanKaro @ahmedzzabdalla0 and others