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

Ignored buymaxsize #250

Closed
TICLAB opened this issue May 26, 2021 · 25 comments
Closed

Ignored buymaxsize #250

TICLAB opened this issue May 26, 2021 · 25 comments
Labels
bug Something isn't working help required Help required from a contributor waiting Waiting for a response from requestor

Comments

@TICLAB
Copy link

TICLAB commented May 26, 2021

Hi All,

when the Bot was started it did not respect the buymaxsize present within the configurations and bought for the entire amount of the quote_currency.

"config" : { "base_currency" : "ADA", "quote_currency" : "USDT", "buymaxsize": 500, .... }

Regards.

@delphsmith
Copy link

Hi,
I had the same issue this morning
My buymaxsize is in my json file

@whittlem
Copy link
Owner

It works for me. "buymaxsize" was only accepting an int before but I've updated it to support both a float and int input. I've tried with arguments and in the config.json and I can see app.getBuyMaxSize() returns the correct value.

The only code which uses this is:

                # execute a live market buy
                state.last_buy_size = float(account.getBalance(app.getQuoteCurrency()))
                if app.getBuyMaxSize() and state.last_buy_size > app.getBuyMaxSize():
                    state.last_buy_size = app.getBuyMaxSize()

I don't see anything obviously wrong. Can you confirm you are running the latest code with "git pull" and see if this is resolved now?

@whittlem whittlem added question Further information is requested waiting Waiting for a response from requestor labels May 26, 2021
@delphsmith
Copy link

I had the version from yesterday but i don't think there was change on this part after that.

Michael I know you are only using coinbasepro ? I actually had the pb on binance.
Don't know if it's specific

git pull this morning, We'll see on my next buy, i'll get back to you

@TICLAB
Copy link
Author

TICLAB commented May 26, 2021

Yes I pull this morning, the first buy used all USDT in my wallet after that it got back to working properly.

@TICLAB
Copy link
Author

TICLAB commented May 26, 2021

Confirmed, I just made a new pull and recreated the containers ... during the first purchase did not respect the buymaxsize and it has bought for the full amount of USDT.

@biskuizera19
Copy link

Here he also bought the full amount. Not respecting buymaxsize. I use Binance here

@whittlem
Copy link
Owner

@TICLAB you say it's working but @biskuizera19 say it's not? Are you both using Binance on the latest version?

@biskuizera19
Copy link

sorry I haven't tested it today with the latest pull

@TICLAB
Copy link
Author

TICLAB commented May 26, 2021

Yes, I use Binance. The problem lies in the first purchase, subsequently the buymaxsize is respected correctly and only the first purchase that uses the entire sum of quote_currency

@8080git
Copy link

8080git commented May 26, 2021

Hi, I have the same problem (Binance and latest version). I add, that even with the "buypercent" option does not make BUY, while I tried version 2.13.1, so much older and purchases and sales are done correctly.

@delphsmith
Copy link

still not working :'(

@whittlem whittlem added bug Something isn't working help required Help required from a contributor and removed question Further information is requested labels May 27, 2021
@whittlem
Copy link
Owner

@ronaldderksen, there seems to be an issue with "buymaxsize". You kindly implemented this for us but there is an issue related to it. Can you please take a look?

@djhemp and @dthevenin, you commented on the PR as well. Do you use this feature and is it working for you?

@ronaldderksen
Copy link
Contributor

I will take a look this evening

@ronaldderksen
Copy link
Contributor

Yes, I use Binance. The problem lies in the first purchase, subsequently the buymaxsize is respected correctly and only the first purchase that uses the entire sum of quote_currency

I had exactly the same issue with the 'buypercent'. These are probably rellated.

@delphsmith
Copy link

one of my bot bought ALL my busd and now i'm stuck X'D. Please help asap with this issue :p Thanks guys !!!

@ronaldderksen
Copy link
Contributor

one of my bot bought ALL my busd and now i'm stuck X'D. Please help asap with this issue :p Thanks guys !!!

Can you post your config.json?, without keys and command line arguments?

@delphsmith
Copy link

delphsmith commented May 27, 2021

yep sure

root@jeedom:/home/jeedom/delph/Config# more binance.json
{
"binance" : {
"api_url" : "https://api.binance.com",
"api_key" : "",
"api_secret" : "",
"config" : {
"verbose" : 0,
"graphs" : 0,
"sellatloss" : 0,
"granularity" : "1h",
"disablebuyobv" : 0,
"disablebuyelderray" : 1,
"disableprofitbankreversal" : 0,
"autorestart" : 1,
"sellatresistance" : 1,
"disablebullonly" : 1,
"live" : 1,
"buymaxsize" : "100"
}
},
"telegram" : {
"token" : "",
"client_id" : ""
}
}

i see now... Maybe it should be an INT ???

Can the others having problem share if it's my config the problem or if they put their value as an int and still not working.. ?

@ronaldderksen
Copy link
Contributor

ronaldderksen commented May 27, 2021

Yes, it should be int or float. If not it is silently ignored. I just reproduced that.

This evening I will check the config parser. For now just update your config.json to:

"buymaxsize" : 100

@delphsmith
Copy link

Thanks Ronald, i did that. I'll let you know
Now just have to wait for my last buy to recover, erffff

@ronaldderksen
Copy link
Contributor

It should work. I am running 13 bots, with this option, on binance.

I forced, in code, a buy at startup and noticed the difference.

Ronald

@TICLAB
Copy link
Author

TICLAB commented May 27, 2021

In my case, however, the value was set correctly to int, see the first comment of the issue.

@ronaldderksen
Copy link
Contributor

ronaldderksen commented May 27, 2021

When you start the pycryptobot. Do you see the line 'Max Buy Size'? This is what I see

|                             Python Crypto Bot                                |
--------------------------------------------------------------------------------
|               Release : v2.15.0                                              |
--------------------------------------------------------------------------------
|              Bot Mode : LIVE - live trades using your funds!                 |
|           Bot Started : 2021-05-27 14:49:07.645905                           |
================================================================================
|          Sell At Loss : True  --sellatloss True                              |
|    Sell At Resistance : True  --sellatresistance                             |
|       Trade Bull Only : False  --disablebullonly                             |
|         Buy Near High : False  --disablebuynearhigh                          |
|          Use Buy MACD : True  --disablebuymacd                               |
|           Use Buy OBV : False  --disablebuyobv                               |
|     Use Buy Elder-Ray : False  --disablebuyelderray                          |
|    Sell Fibonacci Low : True  --disablefailsafefibonaccilow                  |
|  Candlestick Reversal : True  --disableprofitbankreversal                    |
|              Telegram : True  --disabletelegram                              |
|                   Log : False  --disablelog                                  |
|               Tracker : False  --disabletracker                              |
|      Auto restart Bot : False  --autorestart                                 |
|          Max Buy Size : 5.0  --maxbuysize <size>                             |
================================================================================

@TICLAB
Copy link
Author

TICLAB commented May 27, 2021

| Log : False --disablelog |
| Tracker : False --disabletracker |
| Auto restart Bot : False --autorestart |
| Max Buy Size : 200 --maxbuysize |

@ronaldderksen
Copy link
Contributor

ronaldderksen commented May 28, 2021

I created a PR, for type, checking for all parameters.

But I cannot reproduce the problem when type is correct. I tried { "base_currency" : "ADA", "quote_currency" : "USDT", "buymaxsize": 5, .... } and get correct buy if I force a buy by changing getAction to always return 'BUY'

@TICLAB Do you know what triggered the buy? Do you have console output?

@TICLAB
Copy link
Author

TICLAB commented May 30, 2021

Given the market trend, I turned off the bot, unfortunately I no longer have the logs. What I can say is that the total purchase happened when I recreated the containers in docker. Sorry for the delay in the response @ronaldderksen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help required Help required from a contributor waiting Waiting for a response from requestor
Projects
None yet
Development

No branches or pull requests

6 participants