ccxt: zaif RequestTimeout

Hi guys. let me know how to resolve the way from this error plz.

target source is follow. limit_ordered_info = exchange_api.create_order(symbol=target_currency, type=‘limit’, side=‘BUY’,

failure parts
exchange_api.verbose = True
limit_ordered_info = exchange_api.create_order(symbol=target_currency, type='limit', side='BUY', amount=amount, price=500000)
print(json.dumps(limit_ordered_info, indent=True))

I already successed the follow all command in zaif.

success
result = exchange_api.fetch_markets()
print(json.dumps(result, indent=True))

result = exchange_api.fetch_ticker(symbol='BTC/JPY')
print(json.dumps(result, indent=True))

result = exchange_api.fetch_order_book(symbol='BTC/JPY')
print(json.dumps(result, indent=True))

result = exchange_api.fetch_trades(symbol='BTC/JPY', limit=2)
print(json.dumps(result, indent=True))

result = exchange_api.fetch_balance()
print(json.dumps(result, indent=True))

error

Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1331, in getresponse
    response.begin()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 1009, in recv_into
    return self.read(nbytes, buffer)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 871, in read
    return self._sslobj.read(len, buffer)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\util\retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 686, in reraise
    raise value
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 389, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 309, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.zaif.jp', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 357, in fetch
    proxies=self.proxies
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\adapters.py", line 521, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.zaif.jp', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1664, in <module>
    main()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/xxxxxxxxxx.py", line 112, in <module>
    result = exchange_api.fetch_balance()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\zaif.py", line 145, in fetch_balance
    response = self.privatePostGetInfo()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\zaif.py", line 368, in request
    response = self.fetch2(path, api, method, params, headers, body)
  File "C:\Users\xxxxx\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\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 367, in fetch
    self.raise_error(RequestTimeout, method, url, e)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\base\exchange.py", line 288, in raise_error
    raise exception_type(output)
ccxt.base.errors.RequestTimeout: zaif POST https://api.zaif.jp/tapi HTTPSConnectionPool(host='api.zaif.jp', port=443): Read timed out. (read timeout=10)

Process finished with exit code 1

env

  • OS:WIN10
  • Programming Language version:
  • CCXT version:LATEST
  • Exchange:ZAIF

Thanks in advance

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (9 by maintainers)

Most upvoted comments

I obeyed the error ,I mean added the source price= 1300000 like that

    market_ordered_info = exchange.create_market_buy_order(
                         symbol= target_currency,
                         amount= target_amount,
                         price= 1300000

But the error occured TypeError: create_market_buy_order() got an unexpected keyword argument 'price'

You should call:

exchange.create_order (target_currency, 'market', 'buy', target_amount, 1300000)

The create_market_buy_order does not support the price argument, therefore you have to use create_order with it. Let us know if it does not answer your question. Thx!