It looks like you're new here. If you want to get involved, click one of these buttons!
InvalidArgument
Unsupported Authorization TypeAuthorizationtoken 0l7xeons4dlvxh37:4Q3BmqwibQ93WsQd4KfIilBhnSi7gz0B6F9Q8DG23SJ6AX1WrkdN9jZ5y0rv96Lj+ftlQDfCEhH9u01H6Bowv8origGySup6/kP71gdnAZdOYPsVocZbmApc+ZQ=')"
Fno_Instruments=kite.instruments('NFO')).sort_values(by='expiry')
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /user/margins HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /instruments/NFO HTTP/1.1" 200 621995
Traceback (most recent call last):
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:449 in _make_request
six.raise_from(e, None)
File in raise_from
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:444 in _make_request
httplib_response = conn.getresponse()
File ~\anaconda3\lib\http\client.py:1377 in getresponse
response.begin()
File ~\anaconda3\lib\http\client.py:320 in begin
version, status, reason = self._read_status()
File ~\anaconda3\lib\http\client.py:281 in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File ~\anaconda3\lib\socket.py:704 in readinto
return self._sock.recv_into(b)
File ~\anaconda3\lib\ssl.py:1241 in recv_into
return self.read(nbytes, buffer)
File ~\anaconda3\lib\ssl.py:1099 in read
return self._sslobj.read(len, buffer)
timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ~\anaconda3\lib\site-packages\requests\adapters.py:440 in send
resp = conn.urlopen(
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:785 in urlopen
retries = retries.increment(
File ~\anaconda3\lib\site-packages\urllib3\util\retry.py:550 in increment
raise six.reraise(type(error), error, _stacktrace)
File ~\anaconda3\lib\site-packages\urllib3\packages\six.py:770 in reraise
raise value
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:703 in urlopen
httplib_response = self._make_request(
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:451 in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File ~\anaconda3\lib\site-packages\urllib3\connectionpool.py:340 in _raise_timeout
raise ReadTimeoutError(
ReadTimeoutError: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ~\OneDrive\Desktop\untitled2.py:137 in
available_margin=kite.margins()['equity']['net']
File ~\anaconda3\lib\site-packages\kiteconnect\connect.py:328 in margins
return self._get("user.margins")
File ~\anaconda3\lib\site-packages\kiteconnect\connect.py:851 in _get
return self._request(route, "GET", url_args=url_args, params=params, is_json=is_json)
File ~\anaconda3\lib\site-packages\kiteconnect\connect.py:906 in _request
raise e
File ~\anaconda3\lib\site-packages\kiteconnect\connect.py:894 in _request
r = self.reqsession.request(method,
File ~\anaconda3\lib\site-packages\requests\sessions.py:529 in request
resp = self.send(prep, **send_kwargs)
File ~\anaconda3\lib\site-packages\requests\sessions.py:645 in send
r = adapter.send(request, **kwargs)
File ~\anaconda3\lib\site-packages\requests\adapters.py:532 in send
raise ReadTimeout(e, request=request)
ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
the request was for instruments api
straddle()
File "C:\Users\ramakrishna\Desktop\minandstra.py", line 517, in straddle
get_single_side_margin(instrument_buy=put_buy_strike, instrument_sell=put_strike_sell, qty=int(put_total_qty))
File "C:\Users\ramakrishna\Desktop\minandstra.py", line 262, in get_single_side_margin
basket_order_margin_single=kite.basket_order_margins([{
File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 780, in basket_order_margins
return self._post("order.margins.basket",
File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 846, in _post
return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params)
File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 924, in _request
raise ex.DataException("Unknown Content-Type ({content_type}) with response: ({content})".format(
DataException: Unknown Content-Type (text/html) with response: (b"
504 Gateway Time-out
\nThe server didn't respond in time.\n\n")Not for Instruments, I am sorry I wrote it as Seperate comments.
srinidhihebbar
srinidhihebbar 9:52AM Flag
Happened Again , it happened for margin API call