Today, I got a lot of these errors. Any specific reason why? Nothing is changed in the code and after the errors when the retry happens, everything works fine again
If you're not doing any computations and still,this error is happening, it maybe due to some network problems. Actually,this error happens when it takes more than the time between two ticks by the on_ticks function to respond.
But if we are using kite ticker in threaded mode, then delay in main function code must not generate such error in the on_ticks function response, right?
This error won't happen in threaded ticker no matter how much time it takes in the second thread. As long as you don't block the streaming in the main on_ticks thread. What's happening is the input coming from the websocket is being received consistently by the program and the processing of ticks is done in another thread asynchronously. But if you don't use threading and process ticks directly in main on_ticks,and if the processing is still going,while another tick is coming,the program can't receive it(connection abrupted) and so the server throws this error.
Thanks for Sunday night response @SRIJAN I understand what you are saying, and that's why I have been using threaded ticker in my code, but still I couldn't understand why I am receiving //ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly// on daily basis once or twice since past week, earlier there wasn't any such error message being received on the same code that I have been running since many months.. Although the code isn't breaking in any of my accounts because I have appropriate control mechanisms built in place, but I just hope it doesn't break someday because of this error..
@SRIJAN Also, can you help me understand if for any account we can get any custom permissions from your team to increase the quantity limit in a single trade by API, which is currently at 1800 for Nifty and 1200 for Banknifty options?
About this error happening, what's the error code you are getting? That would tell the issue.
About quantity freeze, this isn't possible,as these quantity freeze limits are decided by the exchange,not the broker. To tackle this,just use a for loop if you want to take position for quantity more than quantity freeze.
just wanted to know if we can get the freeze limit increased
No, it's being set by the exchange as @SRIJAN mentioned above. You can check all the freeze limits here. You need to break net qty into multiple lesser than freeze qty orders.
==
# Callback for tick reception.
def on_ticks(ws, ticks):
data["ticks"]=ticks
==
Kudos to your speed and of response @SRIJAN
But if we are using kite ticker in threaded mode, then delay in main function code must not generate such error in the on_ticks function response, right?
About quantity freeze, this isn't possible,as these quantity freeze limits are decided by the exchange,not the broker. To tackle this,just use a for loop if you want to take position for quantity more than quantity freeze.
You need to break net qty into multiple lesser than freeze qty orders.