kiteConnect.setPublicToken("yyyy")
Are you using publically exposed app(not restricted to your personal use)?
If not, then you need not set a public token(it's used only for a publically exposed app).
This is fixed. If you send any of the order params with None, you will get the required input exception message highlighting the expected input type.
{
"status": "error",
"message": "Invalid request (failed to decode `price`, got: `None` (expect…
ATR is generally calculated over a period range. I'm not sure, what period range you are looking for but for the live candle fetch historical data fetch is not recommended. Maybe you can try out the combination of historical data for the previous da…
My basket order had only 2 legs (short straddle: CE+PE)
Can you paste here the complete basket margin request param(including both order params)? We will check on this.
The margin returned by the API is different from the margin required during order execution
As explained in the above thread basket margin API consider margin benefit for all 3 legs before the position is created but we have restricted this 3rd leg …
the order gets changed from "Market order" to "Limit order" automatically
This can happen if you place an order on the illiquid stocks.
Can you DM your order_id for the above order? So, we can inspect more.
Are you trying to compare WebSocket streaming LTP with holdings/positions LTP?
If yes, then the LTP field on holdings and positions are not updated in real-time and it's not recommended to use the LTP field from holdings and positions API calls. Th…
From what I understood as per definition on Nse, it's the average of the best bid and offer price at the given time in market depth.
I don't think, it's possible to calculate this field from historical candle data, which has OHLCV.
Where is 'tag' parameter seen once its sent with the order? Can we filter by this tag in console?
No, these Tags are available only in your API order book. Console tags are holdings tags, you can't fetch this in APIs.
I am placing some trades via ap…
At first glance, this looks like a local HTTP connection error. I guess the initial workaround would be to reduce the number of API calls. Maybe add more few more delays between two consecutive requests(including both setups).
connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
I know that this error happens if we open too many web socket connections.
Yes, this happens when you are exceeding the maximum allowed limit for WebSocket…
I observed that first five minute candle suddenly changes after 9:20
Are you trying to fetch historical data/candle data for real-time formation? Then possibly, you would be requesting for required candle before its formation.
If yes, then it's not …
I have put 2 sec delay between two u.instruments() API calls. I am not seeing the issue any longer.
These instrument dump calls are very heavy, so you should call them only once at your end and store the data at your end, for use throughout the day.…
"error in dowloading NIFTY"
There is no error/exception as such from Historical data API. You need to paste here the complete error message along with the requested input params.
I believe it has something to do with the WebSocket read time out.
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
Read time out is not from the WebSocket but from the request m…
Cannot modify Order is being processed ...."
You are trying to modify the order when it's still not in the OPEN state. You need to wait till order reaches OPEN or TRIGGER PENDING state. Go through all order status here.
Which is a better approach,…
Didn't get?
Are you trying to say that, when you initially made the request to fetch kite.order_history(self.p_id), it has thrown error but second request for same order_id went fine?
If yes, it can possibly happen that the order_id at the time of …
No, I was not able to reproduce the error with the given order_param. The order went fine. Until you are sending any other param with None, above error shouldn't happen.
There are three questions in there.
1. is it possible with Kite Connect API?
2. Can I show ticks on my app with this analysis for users?
3. Do I need to get some licence from NSE, BSE for this?
We don't allow Websocket data/tick data to be shown on …
Today i learnt , i need to use small case "amo" to place AMO orders.
You need to use the variety mentioned in the documentation. The documentation mention it since the start.
You need to always refer to the documentation before posting on the forum…
Can this url be on the localhost ? like https://localhost:port
No, it can't be localhost. It should be reachable HTTPs URL. You can use ngrok/others tunnel service, to server locally. Here is an example explanation for the same.
Run exe file from the specific folder but issue still not resolved
No, you don't have to create an executable(.exe) but .php file. Go through examples here.
It's since the start, the publisher and API both needed TOTP(all kite connect 3rd party app either API or publisher). You can go through the announcement here.
httpRequest.ContentType = "application/x-www-form-urlencoded";
You are sending wrong content-type header, it should be application/json, refer complete curl request params here.
BOD(Beginning of the day) process happens every trading day around 6 AM, this is when the close field is updated. You should check post-BOD period, to get the previous day's close value.
As we used Kite Publisher (Basket API) we will not received order_id
Ultimately all these orders(from all sources) are reflected in your Kite web orderbook. You can refer to your kite web order book for order-related details.
Our Order ID 11909,11910
These are not order_id but your tag field param. You need to DM us order_id's for which you didn't get a postback response. Also, mention your API key.
During these hours i was getting limited tokens not the whole list of 100 tokens.
You will receive tick data for subscribed instrument token, only if there is change in any of the mode fields. As, @sujith explained above.
Ans also can u suggest bes…
(1) if the port HAS to be 443?
Yes, postback URL has to be HTTPs which uses port 443.
(2) I dont have a domain name yet, therefore punched the "https://" , is this allowed ?
No, it should be reachable HTTPs URL. You can use ngrok/others tunnel serv…
def on_ticks(ws, ticks):
tickHandler(ticks, entry, target, stop, True)
You need to remove any computation inside the on_ticks main ticker thread. Go through WebSocket FAQs here.
We are investigating this on utmost priority. But, we are not able to reproduce this except only when you send the wrong order param like wrong symbol, exchange, etc.
Can you re-check at your side, if you are sending all correct order params?
Do p…
Some of those instrument tokens are 18325250, 19770626, 37916930. However, I am not getting this error when I subscribe to other instrument tokens such as 272376070.
It may be because of the token format you are sending for the subscription. This th…
Can you please give a few of those order placement params(which are throwing above input exception)? As this error message is thrown only if the limit price field is send as zero.
Also want to check same for WebSocket streaming?
Didn't get you?
Websocket streaming don't have instrument list. You will have to fetching instrument list using Instrument API call.
if we check the OI for the same script on the NSE option chain it gets different, why it is different.
This thread explains your above query.
is there any formula to calculate Change in OI?
We don't have a change in the oi field for Quote API/WebSo…
You can fetch full instrument list.
is there any limitation on instrument API call?
Yes, we will recommend you to fetch this instrument list at the day start and store it at your end, as it doesn't change throughout the day. You fetch the same on th…
"Markets are closed right now. Use GTT for placing long standing orders instead.
Make sure, you are assigning "variety": "amo", not "regular" in order param. Refer to all order param here.
If still facing issue, please paste here the complete reque…
Do you mean websocket on_order_update? This one?
def on_order_update(ws, data):
logging.info(f"{data['status']}.")
webs.on_order_update = on_order_update
To check the status of an order, can we do:
There are multiple way to fetch order update status. Best would be to use on_order_update, if you are already connected to websocket streaming .
If you are not connected to WebSocket, you can use kite.ord…
For WebSocket connection, auto-reconnect is set by default using reconnect=True.
For APIs, you need to handle local disconnection at your end using exception/time-out handling.
how can I use this function??
def set_session_expiry_hook(self, method)
…
You don't seem to have gone through the above-linked thread, which explains this query.
So, to iterate the same, node js time object by default convert any timezone to GMT. So, your request from time object of 09:15:00 became 03:45 i.e 09:15:00-05:3…
Message: Unable to connect to the remote server
Looks like a local network proxy issue. Can you check on your network?
Problem with wss://ws.kite.trade?
No, it's working fine at our end. All API users including our front-end application use the same…
The issue is you have created another daemon thread using threaded = True, but that thread is not handled properly using initialization and callbacks. If you don't need another ticker thread, you can avoid assigning threaded=True and use main ticker…
websocket.subscribe([keyvalue['TRIDENT'][0], keyvalue['UNIONBANK'][0], keyvalue['IDBI'][0],
AttributeError: 'NoneType' object has no attribute 'sendMessage'
Have you initialised websocket properly? Make sure, you are assigning callbacks at end. Refe…
You don't need a refresh token, it's is only available to certain approved platforms. Go through the profile response attribute detail here.
You need access_token to make API requests. The refresh token is not for retail users.
You need API access to use holdings auth(as it requires a user's holding permission), which won't be available in Kite Publisher.
So, either you can take an API subscription or manually go to kite web/app and authorize required holdings from UI.
entire script of historical data fetching process
We don't have a retry mechanism in historical data requests out of the box. You will have to handle the above exception at your end and retry with some sleep time in between consecutive requests.
I'm getting error when I tried to fetch /mf/instruments list/getMFInstruments, not able to find root cause. can you
This is fixed, you can use the same.
you can directly download instruments list by using this link - https://api.kite.trade/instruments
This instrument list won't contain an MF instruments. MF instruments can only be downloaded from here.