But not able to close or stop the connection cleanly after market hours. I need success status after the 3:15pm but not able to get so by kws.close() or kws.stop().
I am trying to do the similar thing. But so far no success. Once we execute kws.connect an infinite loop starts. And the callback function on_close is only called when the main function stops receiving all the ticks and that includes post market hours as well, so it extends till 5pm i think. So i don't think there is any solution for this, except force closing the program