chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis
MIT License
5.06k stars 1.1k forks source link

Fetching error ETIMEDOUT on buy order #249

Closed Suniron closed 3 years ago

Suniron commented 3 years ago

Hey there,

I have a fresh deployment of this bot on my Rapseberry Pi 4 with Raspbian 64 Bits since midday.

After few hours of running, the bot detect the first opportunity to put a buy order! But... it fail again and again..

The error which is showed is theese:

Execution failed (14:57:53.113)

Job: Trailing Trade Indicator
Code: ETIMEDOUT
Message:

request to https://api.binance.com/api/v3/openOrders?symbol=XRPBUSD&recvWindow=10000&timestamp=1627138543894&signature=595c4714b0c9ed72989ef823e0a1aea5a4b64f355eef27131b failed, reason: connect ETIMEDOUT 52.222.192.131:443Stack:FetchError: request to https://api.binance.com/api/v3/openOrders?symbol=XRPBUSD&recvWindow=10000&timestamp=1627138543894&signature=595714b0c9e9ef823e0a1aea5a4b64f355eef27131b2e failed, reason: connect ETIMEDOUT 52.222.192.131:443

   at ClientRequest.<anonymous> (/srv/node_modules/node-fetch/index.js:133:11)
   at ClientRequest.emit (events.js:375:28)
   at TLSSocket.socketErrorListener (_http_client.js:475:9)
   at TLSSocket.emit (events.js:375:28)
   at emitErrorNT (internal/streams/destroy.js:106:8)
   at emitErrorCloseNT (internal/streams/destroy.js:74:3)
   at processTicksAndRejections (internal/process/task_queues.js:82:21)

- Current API Usage: 228

(I just mofidied the signature to give the error here 😉).

An idea?

Suniron commented 3 years ago

I see that the date in the message is not the same of the system.

It's shifted by 2 hours (I'm in France where it is GMT+2).

I had checked the date on the 3 docker image and it's the same, see bellow:

Screenshot_20210725_005907_com.server.auditor.ssh.client.png

But in slack bot message the date is shifted:

Screenshot_20210724_235414_com.Slack.png

chrisleekr commented 3 years ago

First of all, this is not a bug of the bot.

Secondly, there are already closed issues related to ETIMEDOUT. Please search first before you submit the issue.

Please close the issue if your issue is duplicated.

Suniron commented 3 years ago

Of course, I had consulted the other issues but the cause does not seem to be the same: it seems that there is a problem with the time of the request made to the API.

chrisleekr commented 3 years ago

Hi @Suniron

The error is caused due to timeout between your bot and Binance API. It's most likely caused by your RPi has a slow network. If you are using WiFi, try ethernet.

Suniron commented 3 years ago

Thanks for your answer @chrisleekr.

I'm already connected over ethernet 😔.

It's strange that the time in parenthesis, after the message Execution failed is not the same as the system / the docker image.

Is it just a log problem with this time error?

.. Because, I think, if the requests was sent with a bad time, the binance api server block them.

chrisleekr commented 3 years ago

@Suniron

Yeah, the error does not stop the bot from working. I mean, eventually, the request will go through and process the request. But those error messages would be so annoying to receive.

I suggest trying with Cloud if you don't have any other option.

Suniron commented 3 years ago

@chrisleekr

Mmmh effectively, I just see that 3 order are opened this morning like that:

Screenshot_20210725_144059.jpg

But all other open order who got the ETIMEDOUT ERROR are failed ant don't appear in the Binance interface.

I think that the probleme isn't far, link a date sync problem.

chrisleekr commented 3 years ago

Ok, please close the issue if your issue is resolved.

Suniron commented 3 years ago

Ok, please close the issue if your issue is resolved.

It's not solved, I use a fork we're I haven't the problem :(

Zaabure commented 2 years ago

@Suniron Which fork do you use? I have the same issue, checked all others, tried DNS change, sitting on 1000 MB/S optical, but it's still not working..