We just tried and these instrument tick is coming fine at our end.
2021-12-16 15:26:50+0530 [-] {'tradable': True, 'mode': 'full', 'instrument_token': **5215745**,
'last_price': 149.9, 'last_traded_quantity': 17, 'average_traded_price': 148.97, 'vo…
This is throwing the correct error message. You need to set trigger_price lower than LTP for SELL SL/SL-M order. As these are stop-loss orders. You can go through this article to understand on SL/SL-M working, read Alternate use of SL order: sectio…
i wanted to place short order which is SL-M at 92.55
same for the long order which is SL-M at 92.75
Let us know, all order placement params for this including transaction_type, trigger_price, current_ltp(as reference).
We just checked SL-M buy order trigger price above LTP and SL-M sell order trigger price below LTP but greater than lower circuit price, both are working fine.
Make sure, you are entering trigger price higher than LTP for SL-M buy order and trigger …
No, to generate a request token you need to login manually to this end-point: https://kite.zerodha.com/connect/login?v=3&api_key=your_api_key
You can check the complete login flow documentation here.
Is it possible to manually push the websocket stream?? so that it will help me to continue the development activities after the market hours too.
For NSE and BSE contracts, WebSocket streams will be available till market time(i.e till 15:30). And if…
You can go through the Update (9th Dec 2021) section at the start of this article to understand consultation paper implications on API users.
We are also studying the paper. SEBI is seeking public comments, so if you have any, please e-mail them dir…
Is there any deadline for 4.0.0?
No, there is no deadline for this. You can use the required version as per your convenience. If any mandatory upgrade is required, we will announce the same on the forum.
Can you let us know, which python client version you are on?
Paste the output of pip show kiteconnect.
Also, change exchange="MCX"(string) instead of using kite constant and check.
Is there any changes between order placement between 3.7.7 and 4.0.0.
No, there are no order placement changes. You can go through the complete release note here.
also is there any specific reasons why ticker field names has been changed?
Yes, this…
https://api.kite.trade/instruments/historical/10834690/day?from=2021-12-07+09:15:00&to=2021-12-08+09:15:00
For day candle data, you just have to send the date field not the time field. As, here for to=2021-12-08+09:15:00, it will consider 08th 0…
Also, FUTs will not be have active data for T-2 months or before
The MCX FUT contract will have continuous data i.e day candle for more than 10 years from 2011 onwards.
Similarly, can we get a minute candle for CDS like USDINR?
Currently, we don't…
@Duke2sky
When I ask for nifty 50 historical data on 06dec2021 it is also giving data with timestamp 0645 hrs
Can you check, if you are setting/manipulating tzinfo(time zone) in pandas? As, python historical data, date field is timezone aware field…
error code: ECONNABORTED","error_type":"NetworkException"
This time-out is from your local machine/network, you need to check on your local network connection.
Is another API calls getting executed?
Is there a way in the API, to get all strike prices (OHLC data) on a intraday/EOD level
No, there is no out of the box API available for this but can build it at your end using an instrument list and historical data APIs(if you are looking to fetch …
There is no direct API endpoint/stream to fetch option chain. You need to build it at your end using Websocket streaming or Quote APIs, depending on your usability. This thread explains a basic flow to create an option chain.
You can go through v4.0.0 update announcement here.
timestamp is updated to exchange_timestamp, to make all ticker field naming constant across all client library.
Is enum34 a required dependency? Can you let me know what APIs would be affected if enum34 is required?
No, it's no more required dependency for python version > 3. It's only required for the python version 2.7 for the python kiteconnect client. …
So unless there is any tolerance added to the calculation, I fail to see how Zerodha claims it to be 6042.65
Margin calculation takes open orders as well. You need to check if you had any open orders at that time.
Please help to know is data gets corrected and by what time.
All post-market data is corrected in the post-midnight BOD process.
You can avoid these post-market data at your end, by sending to period till 15:30.
kite.historical_data(instument_token of all NIFTY 500 Symbols ,25 DAYS BEFORE TODAYS DATE, TODAYS DATE TIME,'15MINS')
Live candle fetch is not recommended. You need to form candles at your ending, using WebSocket streaming. This thread explains more…
Is there any impact on currently working existing (old) API in case its not upgraded to latest version?
No, it won't impact your existing setup, but you won't be able to receive BCD ticks using WebSocket streaming.
You were sending an extra quote in your API key for the WebSocket connection. You were sending : ..?api_key='your_api_key'
correct would be : ..?api_key=your_api_key
Hence it kept throwing 403.
Please don't post account-related information here. You can DM me such details.
Does it mean generate using renew_access_token() ?
No, i mean to re-run login flow and generate access token again. For your flask app, you can visit /login.
@app.route(…
If still facing the issue, you need to print the socket_url and DM me the url. Something like:
# Callback for successful connection.
def on_connect(ws, response):
.....
print(ws.socket_url)
I don't see any issue in your WebSocket code, except for the access token. Can you re-generate the access token and check again?
Also, print access_token while making API requests and subscribing to Websocket and compare, if both are the same.
We haven't done any changes from our side. Also, I just tried a similar websocket code flow at my end as you stated above, and it's working perfectly fine.
Are you able to make other API calls using same access_token? Like order book, portfolio fet…
@vijoeyz
v3.9.5 has breaking changes. You need to upgrade to a stable version v4.0.0. The same was announced here.
You can upgrade using pip install --upgrade kiteconnect
Couldn't find that `order_id`.
Has it happened only for that specific order or it's happening continuously?
Also, can you check the complete order book and paste order response for the same order here?
Basically I am looking at a way to fetch OI of Nifty options every 5 mins. Which is the best way to do this ?
You need to use WebSocket streaming to fetch the current oi value.
Historical data API is only meant for backtesting historical data, not …
Is level-2 data of the pre-open market is valid or else they showing it randomly?
We just relay what exchange streams.
Also, during the pre-open session 09:00 to 09:08 AM is just an order collection. So, offers and bids can be random. Orders are ma…
{"status":"error","message":"TOTP is mandatory to place orders on third-party apps. Learn how to set up TOTP for your account [here](https://support.zerodha.com/category/your-zerodha-account/login-credentials/login-credentials-of-trading-platforms/a…
how can we relate ltp value to ohlc ?
LTP and OHLC are unrelated. OHLC is for the whole trading day, whereas LTP is for the current market price. If you are looking to fetch the last traded price in the live market, you will have to use last_price f…
def close_process():
on_close
This is not the correct way to call the on_close method. You need to assign a callback with kws object for calling the same. Something like:
kws = kiteTickerInstance(acc_token)
.....
kws.on_close = on_close
Is the data flow working properly?
Yes, I just checked the WebSocket stream for a few active contracts and can confirm, it's updating in real-time.
My internet is working correctly, but the data is flowing slowly.
Can you paste debug log here?
Instrument token 151071236.
There was no volume for the specific contract during the mentioned period, so the candle wasn't formed. Candles won't be formed if there is no tick for the given time period.
All these are corporate action.
FEDERALBNK: Between dates 2015-06-01 to 2015-07-07
FEDERAL BANK LTD. 08 Jul 2015 Bonus issue 1:1 09 Jul 2015
M&MFIN continuous future
Right Issue of Equity Shares -- 22 Jul 2020
You can check all these corporate a…
I did not Tick data for options instruments between 11:55 AM and 12 PM
There was no issue at our end. Can you check your log, if there was WebSocket disconnection at your end(most common because of local network disconnection)?
is there any way to avoid timeout?
These time-outs are mostly because of local network disconnection. You need to maintain an undisruptive internet connection.
sleep(sleep_time)
continue
Just remove sleep from on_tick main thread. Python WebSocket will keep the connection active. You can check the client implementation here. Also, make sure, there is no other reason for Websocket disconnection like local n…
Name: kiteconnect
Version: 3.9.4
Check for Location in above response.
File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py"
You should check kite connect lib version inside conda env.
AMBUJACEM30DEC2127JAN22FUT
This is a spread contracts i.e spread over two months 30DEC27JAN, you can ignore these. We will remove such spread contracts from the instrument file.
For the rest other contracts, I just tried and it worked perfectly fine…
{"exchange": "NFO",
.....,
"consider_positions" : False
}
order_margins method by default considers existing positions and open orders. You can refer to method detail here. So, you don't have to send consider_positions param in order. You can refer…
Please help me to get the adjacent strikes trading symbols
To form adjacent strikes trading symbol, you can fetch the current spot value using the LTP quote and then add strike Interval(i.e 50, 100, etc) to the strike price.
and price.
For the pric…
I guess that querying the LTP endpoint at the first second of the next minute is the most accurate way
Actually, for previous minute close you need to fetch LTP at HH:MM:59 i.e last tick for that minute period.
it is not possible to set stoploss and target percentage using publisher plugin in a regular order?
No, not in the same regular order. But as another button, you will have to generate this dynamic button with the required SL and target(2 different o…
ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host')
This means, your code tries to reuse the connection just as the server is closing it because it has been idle for too long or the local session is timed out…
You are using an extra backslash in the WS url. Correct WS url would be wss://ws.kite.trade?api_key=xxx&access_token=xxxx. Go through documentation here.
Connection closed: 1006 - connection was closed uncleanly >
This is not the complete error trace-back. Can you paste here the complete error traceback? It would have logged an error message reason as well.
quote api is giving the ohlc from bhavcopy.
Actually, Quote OHLC is streamed directly by the exchange, not from the bhavcopy. The correct article would be this
if "your target condition":
kite.place_order(params)
Or if your target is fixed , place limit order for target as soon as your trade is executed.
Yes, or you can also use GTT OCO order to place both SL and target order for the same.
Are you exceeding the rate limit for historical data APIs?
Dataframe object has no attribute data
This is a panda's internal exception. Can you log the kite connect historical API exception and paste it here?
No, currently kite publisher don't support mutual funds orders. For multi-user support, you can write to kiteconnect(at)zerodha.com with your platform detail use-case.