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

Ошибка которая мешает торговать #18

Open
xsa-dev opened this issue Dec 7, 2023 · 0 comments
Open

Ошибка которая мешает торговать #18

xsa-dev opened this issue Dec 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xsa-dev
Copy link
Collaborator

xsa-dev commented Dec 7, 2023

При запросе текущей цены бывает ситуация когда рушиться процесс из-за того что максимальное кол-во попоток обращения к бинанс заканчивается неудачей:

  1. ставим мониторинг
  2. переписываем на сокеты

image
на картинке вид за неделю (где ошибка - красное)

незаметил что не обновляется и совершилась ошибка

requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f7121199fd0>, 'Connection to api.binance.com timed out. (connect timeout=10)'))
2023-12-06T22:30:30.706823286Z
2023-12-06T22:30:30.706919124Z The above exception was the direct cause of the following exception:
2023-12-06T22:30:30.707030428Z
2023-12-06T22:30:30.707135812Z Traceback (most recent call last):
2023-12-06T22:30:30.707262720Z File "/app/TradingFlow/agent.py", line 437, in
2023-12-06T22:30:30.708512958Z agent_predictions.agent_demo()
2023-12-06T22:30:30.708700605Z File "/app/TradingFlow/agent.py", line 414, in agent_demo
2023-12-06T22:30:30.709013376Z self.loop(train_test=False)
2023-12-06T22:30:30.709169914Z File "/app/TradingFlow/agent.py", line 317, in loop
2023-12-06T22:30:30.709544726Z ) = self.double_dqn_agent.demo(
2023-12-06T22:30:30.709708497Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.709828856Z File "/app/TradingFlow/src/Agent.py", line 528, in demo
2023-12-06T22:30:30.710752037Z reward, done, _ = env_demo.step(action, state)
2023-12-06T22:30:30.710971130Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.711104276Z File "/app/TradingFlow/src/Environment.py", line 185, in step
2023-12-06T22:30:30.711676525Z self.data, last_tick = load_data_ram(symbol=self.symbol)
2023-12-06T22:30:30.711933446Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.712084283Z File "/app/TradingFlow/src/utils.py", line 173, in load_data_ram
2023-12-06T22:30:30.712361582Z data, last_tick = load_to_memory(
2023-12-06T22:30:30.712492104Z ^^^^^^^^^^^^^^^
2023-12-06T22:30:30.712610072Z File "/app/TradingFlow/src/Loader.py", line 95, in load_to_memory
2023-12-06T22:30:30.712841620Z exchange.load_markets()
2023-12-06T22:30:30.713025485Z File "/usr/local/lib/python3.11/site-packages/ccxt/base/exchange.py", line 1458, in load_markets
2023-12-06T22:30:30.713771676Z markets = self.fetch_markets(params)
2023-12-06T22:30:30.713924917Z ^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.714061273Z File "/usr/local/lib/python3.11/site-packages/ccxt/binance.py", line 2013, in fetch_markets
2023-12-06T22:30:30.714721596Z promisesRaw.append(self.publicGetExchangeInfo(params))
2023-12-06T22:30:30.714877744Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.715017853Z File "/usr/local/lib/python3.11/site-packages/ccxt/base/types.py", line 34, in unbound_method
2023-12-06T22:30:30.715219395Z return _self.request(self.path, self.api, self.method, params, config=self.config)
2023-12-06T22:30:30.715396981Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.715521694Z File "/usr/local/lib/python3.11/site-packages/ccxt/binance.py", line 8050, in request
2023-12-06T22:30:30.717904018Z response = self.fetch2(path, api, method, params, headers, body, config)
2023-12-06T22:30:30.718099876Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.718247442Z File "/usr/local/lib/python3.11/site-packages/ccxt/base/exchange.py", line 3315, in fetch2
2023-12-06T22:30:30.719145540Z return self.fetch(request['url'], request['method'], request['headers'], request['body'])
2023-12-06T22:30:30.719327044Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-06T22:30:30.719451627Z File "/usr/local/lib/python3.11/site-packages/ccxt/base/exchange.py", line 620, in fetch
2023-12-06T22:30:30.719790987Z raise RequestTimeout(details) from e
2023-12-06T22:30:30.719946860Z ccxt.base.errors.RequestTimeout: binance GET https://api.binance.com/api/v3/exchangeInfo

@xsa-dev xsa-dev self-assigned this Dec 7, 2023
@xsa-dev xsa-dev added the bug Something isn't working label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant