binance-trading-bot-new-coins icon indicating copy to clipboard operation
binance-trading-bot-new-coins copied to clipboard

Unexpected messages when running main.py

Open vmajor opened this issue 3 years ago • 16 comments

This is the status that was printed in the terminal and I am not sure it is entirely sensible. The account where the API key lives did not and does not hold any balance in the coins named below:

New coins detected: [{‘symbol’: ‘FORUSDT’, ‘price’: ‘0.12880000’}, {‘symbol’: ‘REQUSDT’, ‘price’: ‘0.40160000’}, {‘symbol’: ‘GHSTUSDT’, ‘price’: ‘2.35000000’}, {‘symbol’: ‘TRURUB’, ‘price’: ‘50.00000000’}, {‘symbol’: ‘FISBRL’, ‘price’: ‘11.93000000’}] New coin[‘symbol’] detected, but FORUSDT is currently in portfolio New coin[‘symbol’] detected, but REQUSDT is currently in portfolio New coin[‘symbol’] detected, but GHSTUSDT is currently in portfolio New coin[‘symbol’] detected, but TRURUB is currently in portfolio New coin[‘symbol’] detected, but FISBRL is currently in portfolio

It also appears that the variable symbol should have been populated.

vmajor avatar Aug 21 '21 11:08 vmajor

Are you running it in test mode? If TEST is true in config.yml it will just simulate the trades and store them in a local .json file on the main dir.

CyberPunkMetalHead avatar Aug 21 '21 12:08 CyberPunkMetalHead

I am running it in TEST mode. There is no .json file in the main directory.

vmajor avatar Aug 21 '21 12:08 vmajor

Strange, what your PAIRING set to in config.yml?

CyberPunkMetalHead avatar Aug 21 '21 12:08 CyberPunkMetalHead

Here is the whole thing:


TRADE_OPTIONS: # In your pairing coin QUANTITY: 150 # BTCUSDT will be bought for example PAIRING: USDT # How often to check for posts and run the script # in minutes RUN_EVERY: 0.1 TEST: True SL: 3 TP: 9 ENABLE_TSL: true TSL: 2 TTP: 1

vmajor avatar Aug 21 '21 12:08 vmajor

I'll need to run some more tests and see why you had that output. What's strange is that your bot picked FORUSDT as a new listing but that coin hasn't been added just now, it's been trading on binance for weeks. I didn't get this output today, mine still didn't detect any new coins.

CyberPunkMetalHead avatar Aug 21 '21 12:08 CyberPunkMetalHead

OK. I restarted it after that and have not had any more strange messages, just working...

vmajor avatar Aug 21 '21 12:08 vmajor

Ah, great! Yes that should be fine.

CyberPunkMetalHead avatar Aug 22 '21 09:08 CyberPunkMetalHead

Well, no :) It is not closed. This just happened to the actual new listing. There is still no .json file.

working... New coins detected: [{'symbol': 'WAXPUSDT', 'price': '0.45000000'}, {'symbol': 'WAXPBUSD', 'price': '0.49190000'}, {'symbol': 'WAXPBNB', 'price': '0.00109000'}, {'symbol': 'WAXPBTC', 'price': '0.00001120'}] New coin['symbol'] detected, but WAXPUSDT is currently in portfolio New coin['symbol'] detected, but WAXPBUSD is currently in portfolio New coin['symbol'] detected, but WAXPBNB is currently in portfolio New coin['symbol'] detected, but WAXPBTC is currently in portfolio

vmajor avatar Aug 23 '21 07:08 vmajor

Are you running the latest commit? This should be fixed. At least it seems fixed on my end.

CyberPunkMetalHead avatar Aug 23 '21 08:08 CyberPunkMetalHead

OK I did not check... I just updated my local...and now need to wait for another new coin release. Did WAXP work out for you? Did the bot manage to buy it at open?

vmajor avatar Aug 23 '21 08:08 vmajor

so the bot went past the logic check and detected the coin. It stopped at the convert_volume function due to lot_size being referenced before assignment.

I've tested this block in other bots and worked fine, so my guess is that it's due to the coin being newly listed. I've put out a fix so hopefully that'll take care of it.

If there would only be a way to test this properly and not have to wait for a new coin listing.

CyberPunkMetalHead avatar Aug 23 '21 08:08 CyberPunkMetalHead

How does setting lot_size as an integer (0) solve it? Wouldnt it still fail when it tries to run coin not in lot_size? I guess we could set it as an empty dictionary lot_sieze = {}. But if you reckon all newly listed coins will be excepted, the way I think we could solve this is to place an order at a fixed step size say 15, try to buy, if it fails, try step size 14 and then 13 ... and so on until it eventually buys? This would take so much time and would affect the ability to maximise gains tho :/

ghost avatar Aug 24 '21 02:08 ghost

Ah yes, I missed that. I'm now testing it with an empty lot_size dict and then 0. That seems like a good solution. I'll check how it performs now with lot_size 0 and an empty dict and if that doesn't solve the problem we may have to go down the path you suggested

CyberPunkMetalHead avatar Aug 24 '21 06:08 CyberPunkMetalHead

Just an update to confirm that the bot failed at TRIBE, furthermore it also crashed:

New coins detected: [{'symbol': 'TRIBEBTC', 'price': '0.00002198'}, {'symbol': 'TRIBEBNB', 'price': '0.00222000'}, {'symbol': 'TRIBEBUSD', 'price': '1.05000000'}, {'symbol': 'TRIBEUSDT', 'price': '1.07900000'}] New coin detected, but TRIBEBTC is currently in portfolio, or pairing is not USDT New coin detected, but TRIBEBNB is currently in portfolio, or pairing is not USDT New coin detected, but TRIBEBUSD is currently in portfolio, or pairing is not USDT Preparing to buy TRIBEUSDT ran exept block for lot_size Traceback (most recent call last): File "main.py", line 194, in main() File "main.py", line 153, in main volume = convert_volume(coin, qty, price) File "/home/vmajor/binance-trading-bot-new-coins/trade_client.py", line 29, in convert_volume if coin not in lot_size: TypeError: argument of type 'int' is not iterable

vmajor avatar Aug 24 '21 08:08 vmajor

Thanks, that was caused due to an oversight on my part. lot size errors should be fixed now.

CyberPunkMetalHead avatar Aug 24 '21 09:08 CyberPunkMetalHead

Tested and corrected the order errors in the latest commit

CyberPunkMetalHead avatar Aug 26 '21 10:08 CyberPunkMetalHead