Giter Club home page Giter Club logo

Comments (4)

denissonpaz avatar denissonpaz commented on August 17, 2024

I guess this could be the reason:

"Why are my WebSocket connections being dropped/disconnected?
Every 3 minutes, active WebSocket connections will receive a ping. If you do not respond with a properly framed pong, your connection will be terminated."
https://www.binance.com/en/support/faq/360004492232

from pycryptobot.

whittlem avatar whittlem commented on August 17, 2024

I'm not using WebSockets, so I don't think this is related. I'n not sure if your config and your debug output are related. In your config you are trying 15 minute intervals but in your output you are trading 5 minute intervals. I personally would not trade anything less than 15 minute intervals (and only in really good market conditions). With such short intervals you probably would make losses from not covering your fees. The best option is to actually not specify the granularity at all. The bot will then "smart switch" between the 1 hour and 15 minute intervals automatically. This gives the best results.

from pycryptobot.

denissonpaz avatar denissonpaz commented on August 17, 2024

Hi @whittlem , thanks for the hint with eh granularity and the smart switch.

I've changed it and I still got the error though.

I did some tests here, and it seems the poll request takes too long to happen. it's currently set to 300 sec. I just tested it for 180 seconds and now the code is not raising any run-time error.

# poll every 5 minute
list(map(s.cancel, s.queue))
s.enter(180, 1, executeJob, (sc, app))

Log:
2021-04-28 11:00:00 | XRPBRL (BULL) | 1h | Close: 7.46 | v EMA12/26: 7.49 < 7.51 v | v MACD: -0.03 < 0.02 v | v OBV: -377454.6800 (-10.64%) v | ERI: buy | WAIT | Last Action: SELL
2021-04-28 07:27:51 | XRPBRL (BULL) | 1h | Current Price: 7.513
2021-04-28 07:30:56 | XRPBRL (BULL) | 1h | Current Price: 7.499

You may check the configuration and the error below: when running with 300 seconds for the poll
{ "binance" : { "api_url" : "https://api.binance.com", "api_key" : "", "api_secret" : "", "config" : { "base_currency" : "XRP", "quote_currency" : "BRL", "live" : 1, "verbose" : 0, "smartswitch" : 1 } }, "telegram" : { "token" : "", "client_id" : "" } }

Error:
`2021-04-28 11:00:00 | XRPBRL (BULL) | 1h | Close: 7.5 | v EMA12/26: 7.5 < 7.52 v | v MACD: -0.03 < 0.02 v | v OBV: -393008.3400 (-6.95%) v | ERI: buy | WAIT | Last Action: SELL
2021-04-28 07:23:36 | XRPBRL (BULL) | 1h | Current Price: 7.459
Traceback (most recent call last):
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1345, in getresponse
response.begin()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 307, in begin
version, status, reason = self._read_status()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Programs\Python\3.9\env\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\util\retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
raise value.with_traceback(tb)
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Programs\Python\3.9\env\lib\site-packages\urllib3\connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1345, in getresponse
response.begin()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 307, in begin
version, status, reason = self._read_status()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Programs\Python\cryptobot\pycryptobot\pycryptobot.py", line 1063, in
s.run()
File "C:\Users\al\AppData\Local\Programs\Python\Python39\lib\sched.py", line 151, in run
action(*argument, **kwargs)
File "C:\Programs\Python\cryptobot\pycryptobot\pycryptobot.py", line 1019, in executeJob
account.saveTrackerCSV(app.getMarket())
File "C:\Programs\Python\cryptobot\pycryptobot\models\TradingAccount.py", line 293, in saveTrackerCSV
df = self.getOrders(market, '', 'done')
File "C:\Programs\Python\cryptobot\pycryptobot\models\TradingAccount.py", line 94, in getOrders
resp = self.client.get_all_orders(symbol=market)
File "C:\Programs\Python\3.9\env\lib\site-packages\binance\client.py", line 1803, in get_all_orders
return self._get('allOrders', True, data=params)
File "C:\Programs\Python\3.9\env\lib\site-packages\binance\client.py", line 320, in _get
return self._request_api('get', path, signed, version, **kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\binance\client.py", line 265, in _request_api
return self._request(method, uri, signed, **kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\binance\client.py", line 259, in _request
self.response = getattr(self.session, method)(uri, **kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Programs\Python\3.9\env\lib\site-packages\requests\adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))`

from pycryptobot.

JCoyk avatar JCoyk commented on August 17, 2024

Did this process get fixed, I'm having the same issue, I'm on UM_Futures and the same things is happening. I will get a buy trade go thru and then I will wait unitl a cross happens and then it will give me the connection reset error. Please help !

from pycryptobot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.