in one of your promotion email it was said that i can fetch quote for 50 stocks in a go .. , i quickly purchased for same reason , now i am getting exception continuously ..
this is how i called it. kite.quote("NSE",x)
x is list printed below .. i searched it in forum , i dint find solution for the same , instead websockets where suggested without proper example in terms of fetching 50 symbol quote simultaneously .
please provide solution , in case if you r suggesting websocket , please provide an example of same to fetch quote price for 50 symbols
in case if am using wrong API let me know how can i get current buy price for symbol , and how to fetch the same for 50 symbols simultenously .
2. Is there any limit on number of queries i make i might want to query this per second . is not possible let me know how duration can be kept in between two queries .
3. i also tried historical data (minute) get ended up with same exception it will be great if u provide an example . is it possible to club this information as well? where i can fetch per minute histroy for multiple symbols 4. also about placing order buy and sell how much time it takes to execute buy and sell in case if i am doing very fast trade using my algo , can be assured that all my orders will be executing at the same time
Hi, You can try using Kite Connect 3. In one query, you can get the quote for up to 500 instruments. If you are already using Kite Connect 3 then you can enable debugging and check logs.
You can check out Kite Ticker(websockets) usage example in the readme of the pykiteconnect repository.
All the Kite Connect API calls are limited to 3 requests per second.
You don't seem to have an active Historical data subscription. You can go to developers console and subscribe to the same.
i have active historical data subscription and its expiring without using only because nowhere straightway example is mentioned , i dont understand why u dont paste examples here and save our time? instead of making us search all over
it gives errors like . ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using. ]. ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
def on_ticks(ws, ticks): # Callback to receive ticks. logging.debug("Ticks: {}".format(ticks))
def on_connect(ws, response): # Callback on successful connect. # Subscribe to a list of instrument_tokens (RELIANCE and ACC here). ws.subscribe([738561, 5633])
# Set RELIANCE to tick in `full` mode. ws.set_mode(ws.MODE_FULL, [738561])
# Assign the callbacks. kws.on_ticks = on_ticks kws.on_connect = on_connect
@ayyaz I have coded the equivalent in python as follows. This is working fine.
api_key='myapikey' atoken='session_auth token' tkn='token '+api_key+":"+atoken #use a comma separated list for instrument, or single as below inst='NFO:BANKNIFTY18JAN26000PE' #or # inst=['NFO:BANKNIFTY18JAN26000PE','NFO:BANKNIFTY18JAN26000CE']
This is pull request , but i need push one , which will be more precise i think push is over webSockets , i am not able to see precise working example for websocket tick by tick for any 50 instruments . by the way why instrument name is crafted like this NFO:BANKNIFTY18JAN26000PE how can i formulate it generically in case if want LUPIN, SUNPHARMA , etc.. 50 instruments i will would like to pass these symbols to get the current trade (sell ) values tick by tick .
I request Zerodha to give quick answer which is precise in such a way that i can consume it directly ..
@ayyaz would like to know if you found a solution for your query? I am looking for something similar, would be a great help if you could guide on the same.
You can try using Kite Connect 3.
In one query, you can get the quote for up to 500 instruments.
If you are already using Kite Connect 3 then you can enable debugging and check logs.
You can check out Kite Ticker(websockets) usage example in the readme of the pykiteconnect repository.
All the Kite Connect API calls are limited to 3 requests per second.
You don't seem to have an active Historical data subscription. You can go to developers console and subscribe to the same.
Cloning into 'kite3'...
fatal: repository 'https://github.com/zerodhatech/pykiteconnect/tree/kite3/' not found
why dont you paste the example here itself , isnt it simple
You can check out historical_data method here and read documentation for more information.
ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
].
ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
def on_ticks(ws, ticks):
# Callback to receive ticks.
logging.debug("Ticks: {}".format(ticks))
def on_connect(ws, response):
# Callback on successful connect.
# Subscribe to a list of instrument_tokens (RELIANCE and ACC here).
ws.subscribe([738561, 5633])
# Set RELIANCE to tick in `full` mode.
ws.set_mode(ws.MODE_FULL, [738561])
# Assign the callbacks.
kws.on_ticks = on_ticks
kws.on_connect = on_connect
].
ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
please solve this problem , specifically instead of giving random solution
I have coded the equivalent in python as follows. This is working fine.
api_key='myapikey'
atoken='session_auth token'
tkn='token '+api_key+":"+atoken
#use a comma separated list for instrument, or single as below
inst='NFO:BANKNIFTY18JAN26000PE'
#or
# inst=['NFO:BANKNIFTY18JAN26000PE','NFO:BANKNIFTY18JAN26000CE']
headers ={
'X-Kite-Version': '3',
'Authorization': tkn,
}
params = (
('i', [ inst]), )
response = requests.get('https://api.kite.trade/quote', headers=headers, params=params)
qo=response.json()
I request Zerodha to give quick answer which is precise in such a way that i can consume it directly ..
You can get all the instrument tokens in the instrument csv dump. For more information, check out documentation.