MohammedRashad / Crypto-Copy-Trader

A copy trading tool for cryptocurrencies - Binance Exchange
Apache License 2.0
197 stars 84 forks source link

Trades not duplicated #49

Open Benoitseefor opened 3 years ago

Benoitseefor commented 3 years ago

Hey! Thank you so much for this amazing code, I'm currently trying to apply it in a raspberry pi (totally new in coding).

Would be nice if someone could help me: Code was working properly this morning, but right now it doesn't work anymore (trades not duplicated). Here the "error message" appearing in my cmd log.

Thanks!

DEBUG - Event came: {'e': 'executionReport', 'E': 1610824401562, 's': 'LINKUSDT', 'c': 'ios_56699c1a04254e2594d505a7d14a7d89', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '4.80000000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 1291098740, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1610824401562, 't': -1, 'I': 2647974736, 'w': True, 'm': False, 'M': False, 'O': 1610824401562, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '100.60670000'}

2021-01-16 20:13:21,792 - DEBUG - Event came: {'e': 'executionReport', 'E': 1610824401562, 's': 'LINKUSDT', 'c': 'ios_56699c1a04254e2594d505a7d14a7d89', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '4.80000000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 1291098740, 'l': '4.80000000', 'z': '4.80000000', 'L': '20.92850000', 'n': '0.10045680', 'N': 'USDT', 'T': 1610824401562, 't': 68965818, 'I': 2647974737, 'w': False, 'm': False, 'M': True, 'O': 1610824401562, 'Z': '100.45680000', 'Y': '100.45680000', 'Q': '100.60670000'}"GET / HTTP/1.1" 200 -

2021-01-16 20:13:21,794 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1610824401562, 'u': 1610824401562, 'B': [{'a': 'BNB', 'f': '0.00006165', 'l': '0.00000000'}, {'a': 'USDT', 'f': '688.42587600', 'l': '0.00000000'}, {'a': 'LINK', 'f': '0.00604000', 'l': '0.00000000'}]}

Benoitseefor commented 3 years ago

Exception in thread Thread-9:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 1166, in run
self.function(*self.args, **self.kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/binance/websockets.py", line 544, in _keepalive_account_socket
callback = self._user_callback
AttributeError: 'BinanceSocketManager' object has no attribute '_user_callback'

Exception in thread Thread-12: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 1166, in run self.function(*self.args, **self.kwargs) File "/home/pi/.local/lib/python3.7/site-packages/binance/websockets.py", line 544, in _keepalive_account_socket callback = self._user_callback AttributeError: 'BinanceSocketManager' object has no attribute '_user_callback'

mokolotron commented 3 years ago

Hi. I also encountered this error sometimes, but I still haven't figured out what the problem is. The only thing I found was a recommendation from a user that helped to downgrade the python-binance library version to 0.7.3. Therefore, you can write a command pip install python-binance==0.7.3to do downgrade and see if there will be more errors.

paulovisam commented 2 years ago

Oi. Também encontrei esse erro às vezes, mas ainda não descobri qual é o problema. A única coisa que encontrei foi uma recomendação de um usuário que ajudou a fazer o downgrade da versão da biblioteca python-binance para 0.7.3. Portanto, você pode escrever um comando pip install python-binance==0.7.3para fazer o downgrade e ver se haverá mais erros.

@mokolotron @Benoitseefor I've been having this same error for weeks. I tried to install the python-binance==0.7.3 version but it still has the same error. Did you find any solution?

Estou com esse mesmo erro a semanas. Tentei instalar a versão python-binance==0.7.3 mas ainda continua com o mesmo erro. Achou alguma solução?

python == 3.7 ADAUSDT in symbols.csv

My log

192.168.15.5 - - [19/Oct/2021 23:22:58] "GET / HTTP/1.1" 200 - 2021-10-19 23:23:02,351 - INFO - The Crypto-Copy-Trader starts launch 2021-10-19 23:23:02,353 - INFO - Reading configuration file... 2021-10-19 23:23:02,353 - INFO - 1 Slave accounts detected 2021-10-19 23:23:02,354 - INFO - Connecting to the master: Master... 2021-10-19 23:23:04,716 - INFO - Connecting to the slaves. Its can take time... 2021-10-19 23:23:08,234 - INFO - Open masters websocket... 192.168.15.5 - - [19/Oct/2021 23:23:08] "GET /run HTTP/1.1" 302 - 192.168.15.5 - - [19/Oct/2021 23:23:08] "GET / HTTP/1.1" 200 - 2021-10-19 23:23:08,697 - INFO - Launch complete. Now I can copy orders! 2021-10-19 23:23:16,826 - DEBUG - Event came: {'e': 'executionReport', 'E': 1634696596810, 's': 'ADAUSDT', 'c': 'and_191147325cca43319ed0770b26e63d6e', 'S': 'BUY', 'o': 'LIMIT', 'f': 'GTC', 'q': '8.30000000', 'p': '1.50000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 2499881282, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1634696596809, 't': -1, 'I': 5286242995, 'w': True, 'm': False, 'M': False, 'O': 1634696596809, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '0.00000000'} 2021-10-19 23:23:16,827 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1634696596810, 'u': 1634696596809, 'B': [{'a': 'BNB', 'f': '0.20200225', 'l': '0.00000000'}, {'a': 'USDT', 'f': '0.01845225', 'l': '12.45000000'}, {'a': 'ADA', 'f': '0.00000000', 'l': '0.00000000'}]}