Today on 14th May 2024, the finnifty prices were so jumpy in kiteconnect whereas the kite web app was not showing these big jumps. I am providing some info from my logs (Collected before I stopped my program for today):
As you can see, the jumps were more than 60+ within 2-3 seconds. May I know the reason and any ideas how I can avoid for such malfunctions from kiteconnect in my code?
Further, while executing orders for these abrupt changes from my code, some orders were not getting executed and I was continuously facing the below error:
Error: Traceback (most recent call last): File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\sayan\Anaconda3\envs\trading\lib\json\__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users\sayan\Anaconda3\envs\trading\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\sayan\Anaconda3\envs\trading\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\kiteconnect\connect.py", line 924, in _request data = r.json() File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 237, in File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\kiteconnect\connect.py", line 611, in ltp return self._get("market.quote.ltp", params={"i": ins}) File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\kiteconnect\connect.py", line 861, in _get return self._request(route, "GET", url_args=url_args, params=params, is_json=is_json) File "C:\Users\sayan\Anaconda3\envs\trading\lib\sitepackages\kiteconnect\connect.py", line 927, in _request content=r.content)) kiteconnect.exceptions.DataException: Couldn't parse the JSON response received from the server: b"
504 Gateway Time-out
\nThe server didn't respond in time.\n\n" None
I could read through previous discussions on this error in the forum - where some moderator fixed it. But today since I faced this error again, I humbly request any moderator to please look into this. My order execution code is here: