@ssshama
It might be cache, if you would have requested in the same minute interval of candle creation. Can you retry the request for the same interval now?
https://api.kite.trade/instruments/historical/340481/5minute?from=2024-06-13+14:05:00&to=2024-06-13+14:05:00&continuous=0&oi=0
DEBUG: 400 {"status":"error","message":"invalid token","data":null,"error_type":"InputException"}
You are usi…
if the websocket is "close"d without "unsubscrib"ing and connected again after a few seconds (through another internet provider),
Once the underlying network changes, mostly the current websocket connection will be closed. And would require a fresh…
is_connected() is always true but ticks log stops
You won't receive ticks if there is no change in any of the fields for the subscribed mode. You can subscribe to the higher mode(full), and inspect it.
Please let me know how much max time in seconds it takes between gtt is triggered and order is placed?
GTT order is sent to exchange order book immediately, once the condition is met.
I logged in through browser where I was asked to verify captcha
Capta verification is only added to login auth when you have entered the wrong user credential more than 3 times. You need to re-enter the correct credential to remove CAPTCHA.
when it is needed to reconnect to websocket
Didn't get you? All websocket connections are flushed at the end of the day. You need to generate a new access token for the next day.
I am getting ll data except VIX everyday
Historical data for INDIA VIX index(instrument token:264969) is showing fine. Make sure, you are using the correct instrument token.
Are net_change and change are different value all together?
Yes, they are different. net_change is an The absolute change from yesterday's close to last traded price, and change in websocket stream is a % change.
"No server is available to handle this request." exactly at 2024-06-03 09:47:59 while api call of "kite.get_gtts()"
Was it intermittent and only for this API call? Can you paste here the complete error log/trace?
{'NSE:INDIA VIX': {'instrument_token': 264969, 'last_price': 20.08}}
[{'tradable': False, 'mode': 'ltp', 'instrument_token': 264969, 'last_price': 20.08}]
I just checked both Quote APIs and Websocket data for INDIA VIX(instrument token:264969), and …
TypeError: Object of type 'int64' is not JSON serializable
Are tokens a list of Numpy int64 types?
Json does not recognize NumPy data types. You will need to convert the number to a Python int.
self._poller.unregister(fd)
builtins.FileNotFoundError: [Errno 2] No such file or directory
This error comes when you are not handling twisted threads properly. Here is a thread, explaining the same.
ERROR Connection error: 1006 - connection was closed uncleanly (None)
This is related to the blocking of main ticker thread. Go through the websocket FAQs here.
what about data redundancy?
I could see the same data packets being received over web socket.
What are the chances that Zerodha sends some frames/data repeatedly?
No, these are not redundant ticks. A new tick is triggered by the exchange when there …
Bank nifty options are returning empty values
Make sure, you are using correct trading symbol and exchange, as mentioned above. You can fetch the required trading symbol from the instrument list.
ws = websocket.WebSocketApp(
f"wss://ws.kite.trade?api_key={api_key}&access_token={access_token}",
on_message=on_message
Isn't related to the official python kiteconnect client.
WebSocket error: 'WebSocketApp' object has no attribute 'stop'
You are not setting stop callback in the above-mentioned websocket code. Source of this error seems to be different.
"/home/runner/Zerodha-kite/main.py", line 111, in
ws = websocket.WebSocketApp(
Isn't related to python kiteconnect client. Go through the official python kiteconnect library.
Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Are you blocking the main ticker thread?
Go through the websocket FAQs here.
Do you get 502 for all API requests? Or only for orders? Was it intermittent or happen continuously?
anything else I can do from my end to make sure the code doesn’t break?
If it's intermittent, you can handle it with retry.
When its stuck, sometimes it says connection closed uncleanly and sometimes it doesn't.
Check for your local network connection. Make sure, it doesn't suspend. Maybe this thread can help.
Please confirm if you people have added my API in any slower server (Lower Tier).
There is nothing like this. All API requests are treated as same.
If yes, please let me know what should I need to do to get the speed back.
Can you paste here the tim…
historical_data = kite.historical_data(token, from_date, to_date, "15minute")
error : kiteconnect.exceptions.PermissionException: Insufficient permission for that call.
You will need to subscribe to historical data APIs. Go through the FAQs here.
Can I login in 2 different laptops using two different API for each?
Yes, each kiteconnect app(API key) is independent. Just ensure you are within the rate limit and user ID restriction.
kiteconnect.getPositions() API used to return all the positions with the correct net quantity. However last few days it has not updated the quantity when I place an order from Kite web UI
Position APIs will show all the open positions irrespective …
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))
You can try pip install certifi.
Go through installation FAQs here.
@kiteapi
Do you have any plans to do the same for kiteconnect-rs, which was being supported earlier, but I do not see any updates since ~2-3 years now
Kiteconnect-rs is not being maintained, so it has been archived sometime back. You can use other …
TypeError: place_order() got an unexpected keyword argument 'stoploss'
toploss=610
You need to use price and trigger_price for placing stoploss order. Stoploss and square-off were for the bracket order, and it has been deprecated.
Public Token - User generated
It's not required for the generic kiteconnect user, but only for platforms developed using Kite Connect APIs, and exposed to the public.
Access Token - User generated
An access token is valid for the day until the same …
I found NCO as an exchange and it seems to contain commodities
Yeah, it's recently added the NSE-Commodity exchange. We will be making an announcement regarding this soon.
I want to get latest status of multiple orders in one request and on every tick
Didn't get you? Do you want to calculate the P&L of the open order with every tick?
This thread explains P&L calculation in real time.
I am running three subscription programs with the on_order_update program
Why do you need an independent program to get on_order_update? You can consume the same in either of those existing ws connections.
Any exception for on_order_update in futu…
Will the Kite API recognize the on_order_update connection as a WS connection? or will only a WS connection be considered when subscribing to tokens in separate WS programs?
Each program having KiteTicker initialization, is considered an independent…
Are you sure my issue is related to js date object? because i am passing it as string, not from date variable.
We don't handle timezone while converting incoming timestamps from upstream (which is in IST). So if your local timezone is in IST then it…
Can you please share any update.
{'instrument_token': 291849, 'tradingsymbol': 'MCXSILVDEX',
The above query was related to the instrument file, not ohlc quote. That was fixed the subsequent morning file.
yesterday at 8:45, kite.ohlc('NSEIX:GIFT N…
I received opening tick at 2024-04-19 09:15:00 -> 21877.1, while Kite chart and Nse data as well are showing Nifty Fut opening at 21989.9. Why is there such a gap in opening tick?
The open price is decided at the Pre-open session. This article ex…
first minute, the data again fetched but it not fetches all the data , it only fetches 34 stocks data out of 50, and in third minute it fetches 37 stocks data
how i overcome with this issue?, and is it solve using multithreading and fetches all 500 …
This thread explains the post-market ticks sent by the exchange. These are cleared in the EOD chart process i.e post midnight.
the varying market close time between segments, setting a hard limit of a particular time seems counter intuitive.
The re…
The article on the documentation states:
Iceberg orders are available for NSE equity, F&O, CDS (NSE currency segment), and BSE equity only. Iceberg order type is not available for MCX yet.
combination of the 'exchange' and 'tradingsymbol' fields in order to establish uniqueness of each returned instrument
eg: "BSE:1025UCL25"
1. Will this remain as a valid solution?
Yes, it will be a valid UNIQUE key. The case of BSE:1025UCL25 is a cas…
But dot at 3:15, the data feed was not providing updated prices of the BN straddle contracts.
We checked our tick logs, and tick data were coming fine, you can refer to the chart data as well. Can you check for an error log at your end?
go install -v github.com/zerodha/gokiteconnect/v4@latest
package github.com/zerodha/gokiteconnect/v4 is not a main package
As, the error states, gokiteconnect is not main based package but kiteconnect package. The go install command is typically use…
stocks trading in NSE with sector and its stock symbols
You can get all trading symbols based on the exchange, but sector description is not available. Go through the documentation here.
lst_b = [num for num in instrumentsList if num['expiry'] == expiry and num['strike'] == strike and num['instrument_type'] == ins_type
and num['name'] == name]
return lst_b[0]['tradingsymbol']
get_symbols(nte, 'BANKNIFTY', atm_strike, 'CE')
Your abov…