Open ulorentz opened 3 years ago
Try and upgrade unicorn-binance-websocket-api to the latest version (1.33.0), then rebuild your docker image if you use any or simply reinstall dependencies. Before starting the bot make sure you rm -rf data/*.db
first.
The bot stopped trading by days and in the log it's full of the following errors:
binance_trader | 2021-09-07 15:24:19,120 - crypto_trading_logger - INFO - Bought DASH 2021CRITICAL:root:BinanceWebSocketApiSocket.start_socket(94139cd5-6968-4cfa-9ab4-2eaddd3474ed, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1001 (going away), no reason binance_trader | CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(94139cd5-6968-4cfa-9ab4-2eaddd3474ed) 2021-09-09 02:16:00.881571 - CONSOLE - INFO - I am scouting the best trades. CuCRITICAL:root:BinanceWebSocketApiSocket.start_socket(adbcce6a-2a34-4ebf-bd46-fec883c83434, ['arr'], ['!userData']) - Exception ConnectionClosed - error_msg: code = 1001 (going away), no reason binance_trader | CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(adbcce6a-2a34-4ebf-bd46-fec883c83434) 2021CRITICAL:root:BinanceWebSocketApiSocket.start_socket(adbcce6a-2a34-4ebf-bd46-fec883c83434, ['arr'], ['!userData']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason binance_trader | CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(adbcce6a-2a34-4ebf-bd46-fec883c83434) 2021-09-10 01:16:52.142611 - CONSOLE - ICRITICAL:root:BinanceWebSocketApiSocket.start_socket(adbcce6a-2a34-4ebf-bd46-fec883c83434, ['arr'], ['!userData']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason binance_trader | CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(adbcce6a-2a34-4ebf-bd46-fec883c83434) 2021-09-10 20:41:39.754060 - CONSOLE - INFO - I am scouting the best trades. Current c2021-09-10 20:44:40,281 - crypto_trading_logger - ERROR - Error while scouting... binance_trader | Traceback (most recent call last): binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen binance_trader | httplib_response = self._make_request( binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request binance_trader | six.raise_from(e, None) binance_trader | File "<string>", line 3, in raise_from binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request binance_trader | httplib_response = conn.getresponse() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 1348, in getresponse binance_trader | response.begin() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 316, in begin binance_trader | version, status, reason = self._read_status() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 277, in _read_status binance_trader | line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") binance_trader | File "/usr/local/lib/python3.8/socket.py", line 669, in readinto binance_trader | return self._sock.recv_into(b) binance_trader | File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into binance_trader | return self.read(nbytes, buffer) binance_trader | File "/usr/local/lib/python3.8/ssl.py", line 1099, in read binance_trader | return self._sslobj.read(len, buffer) binance_trader | ConnectionResetError: [Errno 104] Connection reset by peer binance_trader | binance_trader | During handling of the above exception, another exception occurred: binance_trader | binance_trader | Traceback (most recent call last): binance_trader | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send binance_trader | resp = conn.urlopen( binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen binance_trader | retries = retries.increment( binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 532, in increment binance_trader | raise six.reraise(type(error), error, _stacktrace) binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise binance_trader | raise value.with_traceback(tb) binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen binance_trader | httplib_response = self._make_request( binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request binance_trader | six.raise_from(e, None) binance_trader | File "<string>", line 3, in raise_from binance_trader | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request binance_trader | httplib_response = conn.getresponse() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 1348, in getresponse binance_trader | response.begin() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 316, in begin binance_trader | version, status, reason = self._read_status() binance_trader | File "/usr/local/lib/python3.8/http/client.py", line 277, in _read_status binance_trader | line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") binance_trader | File "/usr/local/lib/python3.8/socket.py", line 669, in readinto binance_trader | return self._sock.recv_into(b) binance_trader | File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into binance_trader | return self.read(nbytes, buffer) binance_trader | File "/usr/local/lib/python3.8/ssl.py", line 1099, in read binance_trader | return self._sslobj.read(len, buffer) binance_trader | urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) binance_trader | binance_trader | During handling of the above exception, another exception occurred: binance_trader | binance_trader | Traceback (most recent call last): binance_trader | File "/app/binance_trade_bot/scheduler.py", line 25, in _run_job binance_trader | super()._run_job(job) binance_trader | File "/usr/local/lib/python3.8/site-packages/schedule/__init__.py", line 172, in _run_job binance_trader | ret = job.run() binance_trader | File "/usr/local/lib/python3.8/site-packages/schedule/__init__.py", line 661, in run binance_trader | ret = self.job_func() binance_trader | File "/app/binance_trade_bot/strategies/default_strategy.py", line 32, in scout binance_trader | self._jump_to_best_coin(current_coin, current_coin_price) binance_trader | File "/app/binance_trade_bot/auto_trader.py", line 139, in _jump_to_best_coin binance_trader | ratio_dict = self._get_ratios(coin, coin_price) binance_trader | File "/app/binance_trade_bot/auto_trader.py", line 126, in _get_ratios binance_trader | transaction_fee = self.manager.get_fee(pair.from_coin, self.config.BRIDGE, True) + self.manager.get_fee( binance_trader | File "/app/binance_trade_bot/binance_api_manager.py", line 51, in get_fee binance_trader | if not self.get_using_bnb_for_fees(): binance_trader | File "/usr/local/lib/python3.8/site-packages/cachetools/decorators.py", line 26, in wrapper binance_trader | v = func(*args, **kwargs) binance_trader | File "/app/binance_trade_bot/binance_api_manager.py", line 47, in get_using_bnb_for_fees binance_trader | return self.binance_client.get_bnb_burn_spot_margin()["spotBNBBurn"] binance_trader | File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 3131, in get_bnb_burn_spot_margin binance_trader | return self._request_margin_api('get', 'bnbBurn', signed=True, data=params) binance_trader | File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 364, in _request_margin_api binance_trader | return self._request(method, uri, signed, **kwargs) binance_trader | File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 314, in _request binance_trader | self.response = getattr(self.session, method)(uri, **kwargs) binance_trader | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get binance_trader | return self.request('GET', url, **kwargs) binance_trader | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request binance_trader | resp = self.send(prep, **send_kwargs) binance_trader | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send binance_trader | r = adapter.send(request, **kwargs) binance_trader | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send binance_trader | raise ConnectionError(err, request=request) binance_trader | requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) binance_trader | binance_trader | WARNING:apprise:Failed to send Telegram notification to 81065324: Bad Request: can't parse entities: Unsupported start tag "string" at byte offset 336, error=400. CRITICAL:root:BinanceWebSocketApiSocket.start_socket(94139cd5-6968-4cfa-9ab4-2eaddd3474ed, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1001 (going away), no reason binance_trader | CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(94139cd5-6968-4cfa-9ab4-2eaddd3474ed)