@SRIJAN time.sleep is not working in while True: time.sleep(50) 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(60)
@rakeshr, @SRIJAN i'm getting error. My moto is every 5 minutes once, I want the uptaded ticks once for all the 1500 token's ticks in a variable and need to process that variable. Is it possible. ? can you pls help me with it , how to do that ?
M_MFIN, L_TFH, M_M, J_KBANK for these stocks I am not able to get market data. as these stock's symbols have "_" underscore. can you @SRIJAN@rakeshr please support me on this ?
You are sending the parameters directly in the url.
These stocks have '&' in their symbols . & is used to separate the arguments in a url.
So, let's say you fetch quote for M&M,but the server thinks you are requesting quote for a stock called 'M'. Thus,no data.
You have to use '%26' in place of '&' in the tradingsymbols.
Like this:
&i=NSE:M%26M&i=NSE:J%26KBANK&i=NSE:L%26TFH.
Or,send symbols in the params value in the get function. The requests library will automatically convert '&' to '%26' for you.
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)
I'm getting this below error when I use time.sleep in def on_ticks(ws, ticks):
and the kws.connect is disconnected ?
what should I do next?
could you please help me with this ? @sriJAN
The solution is here:
https://kite.trade/forum/discussion/comment/25535/#Comment_25535
You can understand the reason for this here:
https://kite.trade/forum/discussion/11143/lot-of-error-kiteconnect-ticker-connection-error-1006-connection-was-closed-uncleanly-none#latest
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
while True:
time.sleep(50)
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(60)
. its is executing the output for many times
time.sleep()
suspends the thread, you can try using threading.Timer().can you pls help me with it , how to do that ?
Market quotes are the perfect way for snapshot data .
https://kite.trade/docs/connect/v3/market-quotes/#market-quotes
https://kite.trade/docs/connect/v3/market-quotes/#instruments
There are no underscores in the tradingsymbol of these stocks. There are ampersands in the tradingsymbol of these stocks.
Like:
M&M,J&KBANK.
Look at this @SRIJAN, @rakeshr Im getting no data for those stocks. is there any error on this ?
These stocks have '&' in their symbols . & is used to separate the arguments in a url.
So, let's say you fetch quote for M&M,but the server thinks you are requesting quote for a stock called 'M'. Thus,no data.
You have to use '%26' in place of '&' in the tradingsymbols.
Like this:
&i=NSE:M%26M&i=NSE:J%26KBANK&i=NSE:L%26TFH.
Or,send symbols in the params value in the get function. The requests library will automatically convert '&' to '%26' for you.
Like:
requests.get(url,params=params).