how to get last executed total sell quantity and total buy quantity at the exchange?
You can get last_traded_qty from quote API or websocket streaming.
We just checked for the same period and it's matching fine. You would be requesting for wrong period.
"candles": [
[
"2021-08-26T00:00:00+0530",
3057.3,
3089.9,
3032.85,
3045.05,
1504800
]
…
I want to read orders from excel where I will mention entry, exit & sl price & want python to read the excel sheet every day at market open & punch order as soon as the price reaches to that price.
We don't have an out-of-the-box useable…
You can look at this. Each API requires a different set of params, so you will have to select the required method in the above py lib documentation to know more.
please check into it. Link : https://kite.zerodha.com/connect/login?v=3&api_key=apikey
We just checked this at our end. It's loading fine along with auth flow working fine at our end.
Can you check your local connection?
But it should return a dictionary.
place_order extract order_id value from the dictionary. So, it returns a value i.e string in python client lib.
'order_id = kite.place_order('REGULAR','NSE','SBIN','SELL',1,'MIS','LIMIT',price=430)'
You need to us…
I have changed the default self.subscribed_tokens[token] = self.MODE_QUOTE to self.subscribed_tokens[token] = self.MODE_FULL
No, changing mode value in subscribed_tokens dict won't help as it's used only to maintain instrument token dict at the cli…
NICKELAUG21SEP21FUT, NICKEL, 2021-08-31
NICKELAUG21OCT21FUT, NICKEL, 2021-08-31
Both are spread contracts. Kite Connect doesn't support placing the order on spread contracts. You can filter such contracts out.
I confirmed multiple times that I can login to another account and kite does not validate the api_secret.
No, this shouldn't happen. We do validate checksum(which is SHA-256 of api_key + request_token + api_secret) at backend. You can refer to the c…
ws.onmessage = (msg) => {
console.log(msg.data);
};
It's a binary packet, as explained in the documentation. You will have to parse this binary packet.
For example, you can look to node js binary parse implementation here.
Just wanted a confirmation, will i be able to use kite connect APIs using python if I migrate to Orbis.
Yes, everything for the client remains the same, we just do settlement and another process differently at the EOD for Orbis clients. This article…
can I build a mobile app of my own and integrate it with Kite for sending orders similar to Kite publisher ?
You can build an app and integrate Kite publisher in the same. I guess, this serves your usage purpose.
Is there any throttling applied on Historical API for client Apps?
Yes, there is a rate limit of 3req/sec. You can check all rate limits here.
Any alternative to avoid this problem?
You can form candle at your end. This thread explains more on this.
This token:- 128104964 is for ACC NSE Equity Cash
No, Instrument token 128104964, is for ACC-EQ BSE.
128104964,500410,ACC,"ACC.",0,,0,0.05,1,EQ,BSE,BSE
Instrument token for ACC-EQ NSE is 5633
5633,22,ACC,"ACC",0,,0,0.05,1,EQ,NSE,NSE
You can check al…
Did the tick streaming stop for an hour yesterday?
i do not see any ticks from 20 august 13:59:13 to 14:25:53
We checked chart for NIFTY21AUG16400PE and can see data for the mentioned period 20 august 13:59:13 to 14:25:53. Chart/Historical data uses…
x = requests.get(url, headers=headers)
candle_minute_close = x.json()['data']['candles'][i][4]
TypeError: 'NoneType' object is not subscriptable
You seem to be setting wrong requests for historical data. Can you let us know more about url and heade…
curl_setopt($ch, CURLOPT_URL,"https://kite.zerodha.com/api/login");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"user_id=########&password=########");
You are using wrong kite connect login URL. You can refer to comple…
{"status":"error","message":"Invalid JSON payload in `data`.","data":null,"error_type":"InputExcepti
You need to re-check if you are sending the correct orders field, like tradingsymbol, exchange, etc. Refer here an example for the same.
Currently, in instruments.csv we don't have a lot size detail for MCX contracts. It don't change so often, so maybe you can set this multiplier constant at your end. You can refer to this post.
NIFTY2181816600PE
This contract expired on 2021-08-18. You won't be able to fetch historical data for an expired option contract. You can only fetch continuous data for FUT contracts.
'average_price': 0.0, 'volume': 0, 'buy_quantity': 0, 'sell_quantity': 0,
Looks like, you were trying to check this in non-market hours.
During non-market hours, you would only receive the last cached tick.
{"status":"error","message":"Invalid `api_key`.","data":null,"error_type":"InputException"}
As the error suggests, you seem to be sending the wrong API key. You can re-check on that, you are sending API key from the developer console.
If you are st…
Do we have any api that I can use to calculate margin required for any particular trade
Yes, you can use order margin APIs.
any api that can give information about upper / lower circuit ?
You can use Quote API.
s the firewall the reason for this?
Yes, at an initial glance looks like. As you don't seem to block ticker thread, from your code.
Connection closed: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: close reason witho…
is token generation has some time duration i mean to say in the morning time
No, fixed time as such. The previous access token is flushed at 08:35 AM. So, the access token created after 08:35 AM should be valid for the day.
The user is not enabled o…
the issue is occurring with other kite calls like in fetching order history , order book,etc
How frequent are these? Can you paste debug logs for the same with timestamp?
@rajista
/orders (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions'))
How frequent is this error?
Maybe you can look into this…
I just placed the above order with the exchange as NFO. Order was placed successfully.
kite.place_order(tradingsymbol = 'BANKNIFTY2181236200CE',
variety = kite.VARIETY_REGULAR,
exchange = kite.EXCHANGE_NFO,
…
Order timeout during the first few minutes should be fixed, since a couple of days back. You can check and do paste the debug log if it still happening quite frequently.
Make sure, you are making a Form POST request to session/token instead of default JSON POST and send all body param(-d) as the form body. You can check the curl request for the same here. You can know more about request structure here.
Is there any way to trade in options in Kite Publisher?
Yes, you can use option contracts in publisher.
I tried using NIFTY26AUG16300CE and NIFTY2152715300CE but nothing seems to be working.
You seem to be using the wrong trading symbol, as 26th A…
watchlist ltp and screen values are not matching
You can go through this article to know more about the above query.
which one to consider as ltp?
You can use Websocket streaming.
I just tried the same request and it's working fine. Actually, we have BSE intra-day data from 2016, 3, 18 onwards. But, still it should show data from 2016, 3, 18 onward inside of time-out error.
kite.historical_data(128028676, '2016-01-01', '2016-…
exchange=NSE&tradingsymbol=NIFTY21AUG16300CE
Exchange should be NFO instead of NSE for NFO contracts. You can know more about the specific instrument from the complete instrument list.
kite.historical_data(128028676, '2016-1-1', '2016-3-31', '15minute, 0, 1)
You are requesting oi=1 for SBIN-EQ symbol. OI value is available only for the F&O contract. You can check all historical data API params here.
"too many requests "
As the error message states, you are exceeding the rate limit defined here, while making an API request. You need to debug this and add the required delay to be within the defined rate limit. Also, looks info there are multiple…
We don't have an in-built monthly period candle. You will have to build this at your end. This thread explains more on customized candle period formation.
Do I need to wait for a certain seconds before fetching the orders?
Though orderbook is instantly updated. But for some foreseen exceptions, better you can add some buffer wait time i.e maybe a few seconds.
{"status":"error","message":"No valid orders found in payload.","data":null,"error_type":"InputException"}
You are requesting the wrong order payload. You need to re-check all order fields. Refer to the documentation here for the order request param…
You will have to build this feature of order placement via Google sheets at your end via Publisher or kite connect APIs. We don't provide this order placement via google sheets out of the box.
It runs for 2-3 ticks and then stops unless is re-establish the connection.
You need to paste the complete exception message. The exception message will have the disconnection reason.
You can use the meta field from the user profile API.
It will have one of the below value:
1> empty
2> consent - Go through CDSL flow for authorization
3> physical - Not required to go through CDSL flow authorization
Profile API sample res…
I just renewed my API subscription after a couple of months, the live feeds code I used to run isn't working
No, there isn't any change in the code. You can check the WebSocket sample code here.
Can you paste the error/exception message here?
We just checked for the same instrument 884737(TATAMOTORS-NSE) OHLC kite web and websocket stream is matching fine.
[{'tradable': True, 'mode': 'full', 'instrument_token': 884737,
'last_price': 292.3, ..., 'ohlc': {'open': 295.0, 'high': 295.5, 'lo…
Which official kite connect lib client are you using?
As raw historical data request fetches TZ info.
[
"2021-06-11T09:15:00+0530",
1575,
1610.5,
1572,
1608.75,
2179
],
[
"2021-06-1…
We aren't able to reproduce this. Tried it for multiple contracts. All shows a single day candle for 20.04.2020 dated.
Maybe paste your debug log, which will give more info.
This will help us to debug more.
"order_type" => "MARKET",
"price" => "0.00",
"trigger_price" => $request->trigger_price,
];
For CO market orders, you have to send only trigger price not limit price field. Price field is meant for CO LIMIT order.
You can know more about…
If we can get historical intraday BANKNIFTY monthly futures data for backtesting? I want the OHLC data for every minute for the expired monthly contracts.
Continous data/expired contract data is available only for the day candle.
@Dileep
"FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\algo\\lib\\site-packages\\kiteconnect-3.8.0-py3.7.egg'" . How to resolve it?
Looks like your python environment variable PATH is not set properly. You can have…
If i try to get continuous data for last 310 calender days I am getting only a few candles. not full 212 day candles.
dt.date.today() - dt.timedelta(310), these includes non-trading days as well saturday, sunday and trading holidays as well. So, the…
my question is, is this range dynamic or it is static for 1 day?
Our RMS team dynamically updates the range all throughout the day to ensure that we remain within the exchange's allowed OI. You can check the bank nifty dynamic range here.
How about 200 orders per minute rule? I believe that is also at Zerodha account level !. Kindly confirm.
Yes.
Also is there any limit on Holdings and positions APIs at account level or multiuser api level?
Yes, all combined GET call should be less t…
I see we need to send order_id as parameter in co order but not clear how we get it.
No, you don't have to send order_id to create a fresh co-order.
Is there any example request or code is there for CO orders which we can check?
You can check all …