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

Bot placing buy orders when "Buy: Trading Enabled" is unchecked #54

Closed
chopeta opened this issue Mar 25, 2021 · 32 comments
Closed

Bot placing buy orders when "Buy: Trading Enabled" is unchecked #54

chopeta opened this issue Mar 25, 2021 · 32 comments
Labels
bug Something isn't working

Comments

@chopeta
Copy link

chopeta commented Mar 25, 2021

First of all, thanks for sharing this. Great work. I am loving it so far...
I've using the bot for 2 o 3 days now...
Took me some time to understand how the set triggers and %s properly for buy and sell, but I think I've finally figured out.

Description

I've disabled "Buy: Trading Enabled" on settings which is displaying correcting on the GUI
However, during yesterday BTC dip the bot started buying all over when it wasn't supposed to do it.
So, the bot didn't respect the configuration.
I had to set "Buy: Trigger percentage" to 0.99 to avoid getting buy orders created, which partially fix the problem but not without problems, because when buy is triggered the bot get hanged on that pair and never moves forward until you reboot the docker.

To Reproduce

Not sure how to reproduce, but I know is still happening on my install.

Expected Behaviours

The bot shouldn't create any buy order when "Buy: Trading Enabled" is unchecked.

Screenshots

image
image
image

Additional context

My setup is running inside a Ubuntu Server 20.04 KVM machine on a Proxmox server with stable and fast internet connection. HW is also pretty fast.
Deployed with docker + docker-composer using docker-compose.server.yml

If you need any additional info. please let me know.

@chopeta chopeta added the bug Something isn't working label Mar 25, 2021
@chrisleekr
Copy link
Owner

Hmmmmm. I have tested this feature and worked as expected.
Let me try again later to find out whether I missed something.

@chopeta
Copy link
Author

chopeta commented Mar 25, 2021

Thanks for the update.
I think it was working originally when implemented and then got affected by some later-on code :-(
I had like 10 orders placed during yesterday BTC correction when the flag was disabled. In matter of fact still is disabled but I am pretty sure the bot will keep buying if Buy params. are meet (I just don't have more USDT right now so no biggy :-D)

@chrisleekr
Copy link
Owner

Wait, are you saying the bot placed multiple orders even if you already have $10 worth of BTC?

@chopeta
Copy link
Author

chopeta commented Mar 25, 2021

Wait, are you saying the bot placed multiple orders even if you already have $10 worth of BTC?

No, I have more than 40 symbols set in the bot.

Yesterday I had a big part of my portafolio is USDT because I was afraid of a possible BTC correction.

To avoid the bot "buying too high" I've disable the "Buy: Trading Enabled" but for my surprise later on I cough the bot doing shopping on more than 10 different symbols :-) I was able to stop the bot, cancel a few active orders and stop the bleeding by setting "Buy: Trigger percentage" to 0.99 and let the bot running again, which early today made the bot stop working on almost all signals missing sell at least in 1 symbol (JUVUSDT), but this last part is another issue that I will report later on ;-)

Please, no complains here, just trying to explain to you what happened.

I am pretty happy with the bot results and amazed by how it works.

@chrisleekr
Copy link
Owner

40 coins? Whoa.. that is definitely not tested and not intended to use.
I am sure you understood the side effect of using 40 coins, right? Each coin will be monitored every 40 secs.

Btw, nice use of trigger percentage :)

So basically what you did is to update global settings by disabling "Buy: Trading Enabled", not symbol configuration per the coin.

But the bot purchased the coins, right?

@chopeta
Copy link
Author

chopeta commented Mar 25, 2021

I've just learned that 40 secs thing in my scenario by reading #52 🤒 hahahaha

We do have to find a way of improving this... will try to came up with something or evaluate how to assist with the proposal described in #52

I could swear that trigger % was the default when you first install the bot... but later on I figured that I was likely a mistake caused by a mouse scrolling using the mouse scroll button on the mouse when on top that field 🤕 very easy to reproduce 🤕 - and that lead me to the other issue I have to report, which is likely the root cause of #32, that is when you use percentages that make order creation fails on Binance side due to invalid/unacceptable amounts, I think the bot somehow crashes for that symbol and stop processing it all together until your reboot the app. I think this can be easily evitable by adding some validation and warnings on the settings GUI so user won't make mistakes when defining the % like I did on my day one and day two... inadvertently first and later on day two by not understanding how the bot works in the first plate (yes, I've set wrong % in the sell section which was cause the same problem of bot stop working - it's actually very stupid but I am pretty sure it happens to other users as well).

And yes, I've disable the "Buy: Trading Enabled" in global and had only 2 symbos in "customised" mode.

The bot is a very avid shopper hahahahaha lot of purchases yesterday...

@chopeta
Copy link
Author

chopeta commented Mar 25, 2021

Can you point me out to which source code file is the buy order creation? Want to try and catch this bug...

@ienthach
Copy link

I confirm. The bot still open buy order with global uncheck.

@chopeta
Copy link
Author

chopeta commented Mar 25, 2021

I confirm. The bot still open buy order with global uncheck.

Thanks for that. At least now I know I am not crazy or something...

@chrisleekr
Copy link
Owner

Can you point me out to which source code file is the buy order creation? Want to try and catch this bug...

So basically, there are steps for each tick.

One of the steps is to determine action which decide to buy or sell: https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/determine-action.js

@chrisleekr
Copy link
Owner

chrisleekr commented Mar 25, 2021

I confirm. The bot still open buy order with global uncheck.

So after you update the global configuration to disable buy, but you did not update the symbol configuration to disable buy. Right?

@ienthach
Copy link

I confirm. The bot still open buy order with global uncheck.

So after you update the global configuration to disable buy, but you did not update the symbol configuration to disable buy. Right?

My sumbols setting allway follow global setting. In UI the buy toggle in symbols is off and the label “trading is disabled” showed.

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

Can you point me out to which source code file is the buy order creation? Want to try and catch this bug...

So basically, there are steps for each tick.

One of the steps is to determine action which decide to buy or sell: https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/determine-action.js

Thanks for clarifying...

I was checking this:

There's at least a misspelling in there in the word "enabled" but more than that, I don't see where's the global config is getting read here...

More over, if I am understanding the code correctly, the check of the global flag for trading would be done in
https://github.com/chrisleekr/binance-trading-bot/blob/1a308bbb00441e5ee0297e4cd80b437bc5b8920f/app/jobs/trailingTrade/step/determine-action.js
And I see no reference for trading enabled in there...

So it looks like the bot is respecting the trading enabled flag for symbols but not globally.

Does that make sense?

@ienthach
Copy link

Screen.Recording.2021-03-26.at.07.00.25.mp4

I record video for the bug. :)

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

Fantastic the video, what did you use to record? AwesomeScreenshot?

Imagine this happening all over the place for more than 10 symbols at time white BTC was plumbing hahahahahahaha

@ienthach
Copy link

ienthach commented Mar 26, 2021

i user macOS, i just combine "Shift + command + 5" it will record for the screen. :D

you are lucky guy.

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

i user macOS, i just combine "Shift + command + 5" it will record for the screen. :D

More than one friend told me to get rid of my windows machines hahahahaha

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

i user macOS, i just combine "Shift + command + 5" it will record for the screen. :D

you are lucky guy.

Not lucky, I didn't want the buys to happen. The bot made the buys when the prices were still "too high"... I was planning on enable trading and catching the dip after BTC was lower than 52K. Of course, easy to say that now hahaha

Anyway, is part of using software... bugs will always be there.

Appreciate Chris help in getting then fixed which is all that matters.

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

Still have a lot to learn and discover in regards to the configuration params.
Find the best combinations for each symbol or for most of my symbols.
Will get there eventually, in the meanwhile would be nice for the bot to respect the global flags hahahaha

@chrisleekr
Copy link
Owner

chrisleekr commented Mar 26, 2021

I record video for the bug. :)

Thanks for the video. Definitely, something is going on.

As you can see from the test - https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/__tests__/place-buy-order.test.js#L220

The buy order should not be placed if the trading is disabled, which the configuration is the symbol configuration.

So possible bug in the global/symbol configuration setting.
Anyway, let me fix up the configuration issue first, which I assume this issue also will be fixed by the change.

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

Just as disclaimer for other people that may read this later on and possibly get wrong ideas...

If you don't want to risky your money, you should really test this bot first for weeks using test mode, and only after that go live.

And do it again every time a new release is published and you plan to upgrade, because at the end of day with you playing with money here.

Be careful and DYOR!!!!

@chrisleekr
Copy link
Owner

chrisleekr commented Mar 26, 2021

Oh -_- I just found typo...... enabed ... Damn...

@chopeta
Copy link
Author

chopeta commented Mar 26, 2021

Oh -_- I just found typo...... enabed ... Damn...

Told you this in one of my prev. comments...

Can I be hired already for the Q&A department?

hahahahaha

Jokes a part, I am glad we're moving forward.

@chrisleekr
Copy link
Owner

Told you this in one of my prev. comments...

I saw your comment, but I didn't know where. :)

Thanks guys.

@chrisleekr
Copy link
Owner

@chopeta @ienthach

I have released a new version that contains the fix for the global configuration.
As well as a typo that caused the issue with buying disabled.

https://github.com/chrisleekr/binance-trading-bot/releases/tag/v0.0.65

Please close the issue if you think it is fixed.

@ienthach
Copy link

im checking on this. thank you.

@chopeta
Copy link
Author

chopeta commented Mar 27, 2021

Will deploy now... How do I upgrade in docker?

@ienthach
Copy link

I do stop docker-compose stop. git pull then start again

@chrisleekr
Copy link
Owner

If you are using docker-compose.server.yml, then simply

docker-compose -f docker-compose.server.yml pull
docker-compose -f docker-compose.server.yml up -d

@chopeta
Copy link
Author

chopeta commented Mar 27, 2021

Thanks for the help with docker guys. Rookie here.
I had to stop, remove the image and then start again.
Just stop and start was not getting the image updated... git pull was the first thing I did.
Anyway, looks like I am on the latest version now, reported #59 just to be sure :-)
Let's see how it goes now...
Thanks for the fixes @chrisleekr, appreciate it!

@ienthach
Copy link

i confirms the bug if fixed.

Screen Shot 2021-03-27 at 14 46 36

@chopeta
Copy link
Author

chopeta commented Mar 27, 2021

Working here as expected.
Thanks for the fix @chrisleekr

@chopeta chopeta closed this as completed Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants