Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Unable to live trade: "Timestamp for this request is outside of the recvWindow" #1014

Open
hmb104 opened this issue Dec 28, 2017 · 5 comments
Labels

Comments

@hmb104
Copy link

hmb104 commented Dec 28, 2017

System information

It happens every few transactions and the bot never breaks as it continues to run.

Describe the problem

In live trade mode in Binance, sometimes the bot is unable to place orders, get balance or cancel orders.

all the time the message is the same "400 Bad Request {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)"

This way the bot sometime cannot trade efficently as it cannot delete orders or show the balances

Source code / logs

017-12-28 17:10:48 0.0125488 BNB-ETH +1.19% 87 50 + -0.0003 0.0397 selling 4.97248993 BNB 0.12668039 ETH -0.22% -0.41%
Binance API is down! unable to call getOrder, retrying in 20s
{ Error: binance GET https://api.binance.com/api/v3/order?timestamp=1514502689244&symbol=BNBETH&orderId=9366045&signature=f0427f9b3da9be32dcb4f9643ecb4e27933246a1b4c3b6dde812770c15622f17 400 Bad Request {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)
at binance.defaultErrorHandler (/home/hmb104/Desktop/zenbot/node_modules/ccxt/js/base/Exchange.js:413:15)
at response.text.then.text (/home/hmb104/Desktop/zenbot/node_modules/ccxt/js/base/Exchange.js:426:25)
at
at process._tickCallback (internal/process/next_tick.js:188:7) constructor: [Function: ExchangeNotAvailable] }
[ { order_id: '9366045', product_id: 'BNB-ETH' } ]

Error: binance DELETE https://api.binance.com/api/v3/order 400 Bad Request {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)
at binance.defaultErrorHandler (/home/hmb104/Desktop/zenbot/node_modules/ccxt/js/base/Exchange.js:413:15)
at response.text.then.text (/home/hmb104/Desktop/zenbot/node_modules/ccxt/js/base/Exchange.js:426:25)
at
at process._tickCallback (internal/process/next_tick.js:188:7) constructor: [Function: ExchangeNotAvailable] }
[ { order_id: '9366738', product_id: 'BNB-ETH' } ]

Any idea? It looks like it is related to CCXT modeul.

Thanks,
HMB

@DeviaVir DeviaVir added the bug label Dec 29, 2017
@kroitor
Copy link

kroitor commented Dec 29, 2017

Solved here by synchronizing time with ntpd very frequently: ccxt/ccxt#936

@trivalik
Copy link
Contributor

I got this error today with current version on windows with vs2017 debugger. I synced my time manual, but still error happen. First restart of zenbot fixed the issue.

@Primea1
Copy link

Primea1 commented Feb 24, 2018

How is this fixed? I get it even if i restart.

@trivalik
Copy link
Contributor

trivalik commented Mar 1, 2018

I synced manual in the date/time dialog.
image

@kroitor
Copy link

kroitor commented Mar 2, 2018

@trivalik enabling that option will not help, it will synchronize time once in a day, which is not enough. You need to set up your registry to synchronize the time more frequently, than it's done by default:
ccxt/ccxt#850. Hope it helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants