-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bot buys coins, even though orderLimitMaxOpenTrades is exceeded #398
Comments
I faced the same situation again this morning. Last night I had 3 open trades with "Max. Open Trades" set to 4 and Curiously, when one of the 6 coins dropped low enough, so the bot would trigger the next grid, it complained that the maximum number of open trades had been reached. The behaviour seem odd, and I cannot quite fathom the cause of it. Could my installation be messed up? How exactly is the bot to behave in a situation with "Max. Open Trades" at 4, "Max. Open Trades" at 2 and already 3 open trades? |
@chrisleekr I hope this is the right place to look at...
PS: This is my first attempt doing anything in node.js. |
My above code doesn't seem quite right.
This would be the corresponding diff against current head:
Comments are greatly appreciated. |
I found a case where above code did not do what it should. So here is a new version:
This is the diff again:
|
This condition will prevent the bot from opening number of trades greater than orderLimitMaxOpenTrades,
but it will not completely solve the problem. For this to work correctly, we must be able to lower |
Could this already do the trick:
?
|
I think this could work.
|
I have put everything into a separate branch for testing: https://github.com/Rayn0r/binance-trading-bot/commits/max_open_trades_fix |
Thank you @Rayn0r |
I have pushed another little fix, but I don't think all is yet working the way it should. With my current code the occasion on when it bought more coins than it was allowed has decreased, but it still happens from time to time. |
I think the better idea will be to keep opening orders without change but as soon as max. open trades is reached when any buy order at |
Today I ran into the situation where all open grid trades for my 3 traded coins fired their last grid trade. "Max. Open Trades" is set to 3 here. Shortly after, the bot tried to purchase three additional coins, that met the buy criteria.
Is this behaviour intentional? One can easily run into the situation, where you run out of coins on a big drop while the bot keeps buying new coins.
I now set my last grid trade to a ridiculously low percentage of 0.01 that will never be reached in order to (hopefully) overcome this issue.
Is there some other measure to prevent above described situation?
Thank you in advance.
The text was updated successfully, but these errors were encountered: