Thanks for your quick response Rakesh, I had gone through the FAQs before starting this discussion. There is nothing wrong with the code as it works most of the times. The problem is it fails randomly during morning hours. Sometime it keeps failings for 20 min but then works. I am looking for stability here.
One point I noticed where you suggested to assign kws.on_ticks = on_ticks in my while loop where I have my trading logic. This, I am not able to understand why? The function name is already assigned in kws instance before starting the while loop correctly. Please advise.
@Anoop I mentioned at other place also. You code might have an issue and when it terminates what you get is the web socket error, which makes you believe into the fact that there is web socket error
Remember this error simply means that code exited for some issue, that would be in your code. And it also resulted in web socket disconnection uncleanly.
Please check your code. I can tell you this is not web socket related issue.
One point I noticed where you suggested to assign kws.on_ticks = on_ticks in my while loop where I have my trading logic. This, I am not able to understand why? The function name is already assigned in kws instance before starting the while loop correctly. Please advise.
I mentioned at other place also. You code might have an issue and when it terminates what you get is the web socket error, which makes you believe into the fact that there is web socket error
Remember this error simply means that code exited for some issue, that would be in your code. And it also resulted in web socket disconnection uncleanly.
Please check your code. I can tell you this is not web socket related issue.