zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
964 stars 461 forks source link

Issue Websocket and kite.ltp in API #193

Open dolaram opened 2 months ago

dolaram commented 2 months ago

WebSocket and kite.ltp apis are very unreliable in the morning trading session, WebSocket/ltp api are not giving the ltp for subscribed scripts in the morning till 10AM leading the code flow to break. Same piece of code for fetching ltp working good after 10AM. We are facing this issue for last 2 weeks.

Below is the error coming when fetching the ltp for first time after 5min of ltp subscription in WebSocket as WebSocket is not proving the ltp code flow is then fetching ltp from ltp api which is also giving below error:

ERROR: ltp = self.kite.ltp('NSE:NIFTY MID SELECT')['NSE:NIFTY MID SELECT']['last_price'] AttributeError: 'NoneType' object has no attribute 'ltp'

Please have a look into the issue.

pseudoag commented 2 months ago

The same is happening with quote too. None is getting returned which causes issues with the algos.

On Fri, Apr 12, 2024 at 11:55 AM Dola Ram @.***> wrote:

WebSocket and kite.ltp apis are very unreliable in the morning trading session, WebSocket/ltp api are not giving the ltp for subscribed scripts in the morning till 10AM leading the code flow to break. Same piece of code for fetching ltp working good after 10AM. We are facing this issue for last 2 weeks.

Below is the error coming when fetching the ltp for first time after 5min of ltp subscription in WebSocket as WebSocket is not proving the ltp code flow is then fetching ltp from ltp api which is also giving below error:

ERROR: ltp = self.kite.ltp('NSE:NIFTY MID SELECT')['NSE:NIFTY MID SELECT']['last_price'] AttributeError: 'NoneType' object has no attribute 'ltp'

Please have a look into the issue.

— Reply to this email directly, view it on GitHub https://github.com/zerodha/pykiteconnect/issues/193, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAQ773OS7SL2KTFO5LGCODY4547NAVCNFSM6AAAAABGDRWNGCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTSMJYGE4DIOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>