This might happen when your main thread which is listening to ticks is overloaded. Try offloading your task to a secondary thread after you receive a tick.
count=0 while True: count+=1 if(count%2==0): if kws.is_connected(): kws.set_mode(kws.MODE_FULL,tokens) else: if kws.is_connected(): kws.set_mode(kws.MODE_FULL,tokens) time.sleep(0.01)
it is not able to get data for all the symbols.
i would also like to know if it is possible for us to tell the websocket not to get data for certain tokens after their exchange time is over , like not getting data for nse equities , fno , options after 3:30 pm , cds and its options after 5:00 pm and likewise for commodities after 11:55 pm ?
Sensum Fintech is a company which aims to democratise algorithmic trading in India.
Our mission is to build India’s first crowdsourced quant fund.
We are looking for algo traders and quantitative enthusiasts who have developed trading strategies for the Indian markets. The signals should be mid frequency or low frequency and derivative strategies are eligible too. We have partnered with a wealth management firm as well as a few of India’s top brokers.
Discretionary traders can also become a part of the company and we can help their strategies to be automated and reach a wider client base.
The perks include capital allocation to your strategies as well as revenue sharing if your strategy is selected to be published on our platform.
Interested people can reach me at [email protected]
Whatsapp : 7021520557
@genesis Instead of redirecting stdout to file, you could simply write that logic inside your script. Websocket disconnects can occur due to several problems. But we do have re-connection mechanism to handle such cases.
Speaking of reconnection , please note that doing a `ws.stop()` inside `on_close` callback will stop the underlying event loop which takes care of the websocket connection. And no reconnection will happen then. So if you have a ws.stop() inside on_close callback and still wants the reconnection, please remove it. Ref comments in https://github.com/zerodhatech/pykiteconnect#websocket-usage.
Can you give us more detail about the above issue? Is there any error, while connecting to WebSocket?
kws.connect(threaded=True)
it exits straight away
if i write something like this :
count=0
while True:
count+=1
if(count%2==0):
if kws.is_connected():
kws.set_mode(kws.MODE_FULL,tokens)
else:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL,tokens)
time.sleep(0.01)
it is not able to get data for all the symbols.
i would also like to know if it is possible for us to tell the websocket not to get data for certain tokens after their exchange time is over , like not getting data for nse equities , fno , options after 3:30 pm , cds and its options after 5:00 pm and likewise for commodities after 11:55 pm ?
Our mission is to build India’s first crowdsourced quant fund.
We are looking for algo traders and quantitative enthusiasts who have developed trading strategies for the Indian markets. The signals should be mid frequency or low frequency and derivative strategies are eligible too. We have partnered with a wealth management firm as well as a few of India’s top brokers.
Discretionary traders can also become a part of the company and we can help their strategies to be automated and reach a wider client base.
The perks include capital allocation to your strategies as well as revenue sharing if your strategy is selected to be published on our platform.
Interested people can reach me at [email protected]
Whatsapp : 7021520557
Instead of redirecting stdout to file, you could simply write that logic inside your script.
Websocket disconnects can occur due to several problems. But we do have re-connection mechanism to handle such cases.
Speaking of reconnection , please note that doing a `ws.stop()` inside `on_close` callback will stop the underlying event loop which takes care of the websocket connection. And no reconnection will happen then. So if you have a ws.stop() inside on_close callback and still wants the reconnection, please remove it. Ref comments in https://github.com/zerodhatech/pykiteconnect#websocket-usage.