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

BinanceでHTTPエラーが発生する #9

Closed
dio16 opened this issue May 19, 2018 · 1 comment
Closed

BinanceでHTTPエラーが発生する #9

dio16 opened this issue May 19, 2018 · 1 comment

Comments

@dio16
Copy link

dio16 commented May 19, 2018

binance API authentication errorが発生し取引が開始できませんでした。
いかにLogを記載します。
エラーを返したURLを見ると、{"code":-2014,"msg":"API-key format invalid."}となっており
フォーマットが変わってエラーを起こすようになったのでしょうか?

Trade mode
LTC/BTC
binance/bitz
minsize:0.1
binance API authentication error
Traceback (most recent call last):
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 364, in fetch
response.raise_for_status()
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.binance.com/api/v3/account?timestamp=1526686993168&recvWindow=5000&signature=4d6e377195c180b2bc4ab09e70855ba802942f5f1301f0a1cacddec4bd5bc9b9

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "arb.py", line 70, in
ex = tools.exchange(t1, t2, info_set, l)
File "c:\arb\tools.py", line 82, in init
self.check_api_state()
File "c:\arb\tools.py", line 112, in check_api_state
t1_base, t1_alt = self.balance(self.t1)
File "c:\arb\tools.py", line 140, in balance
bal = ts.fetch_balance()
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\binance.py", line 388, in fetch_balance
response = self.privateGetAccount(params)
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\binance.py", line 845, in request
response = self.fetch2(path, api, method, params, headers, body)
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 303, in fetch2
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 376, in fetch
self.handle_errors(response.status_code, response.reason, url, method, self.last_response_headers, self.last_http_response)
File "C:\Users\d\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\binance.py", line 838, in handle_errors
raise exceptions[error](self.id + ' ' + body)
ccxt.base.errors.InvalidNonce: binance {"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server's time."}

@dio16
Copy link
Author

dio16 commented May 19, 2018

すみません過去イシューに問題点は報告されておりました。
大変失礼いたしました。

t1.name = config.NAME1の下に
t1.options["adjustForTimeDifference"] = True を追記し正常稼働しました。

ただし、BNB自動購入フラグはONにしておりBuffer.pyも手を加えていないのでどこでおかしくなったのか・・・。

@dio16 dio16 closed this as completed May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant