trading symbol is NIFTY21APR12150CE but expiry mentioned is 4/29/2021
The expiry date is in the format of mm/dd/yyyy. So, it's a monthly contract having expiry as last Thursday of the month i.e 29th April. You can go through this module of the varsi…
@jaskirats
There is some compatibility issue on our latest PHP client, so you need to have PHP >= 8 for this now. We are soon planning to downgrade the PHP version requirement to >=7.3. So, if you want to use the current PHP client, please up…
Can I only purchase the historical kite API?
No, historical data is an add-on base Kite connect APIs. So, you need to purchase both.
I wanted to ask what the extent of the historical data was. By extent I mean, are the historical prices from 2003-20…
When i try to connect using excel i get an error message..Bridge licence expired
I guess you are trying to use KiteXL client for kite connect APIs. @HowUTrade might help.
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
Saw your error log above. An instance of time-out has happened, which can happen because of multiple reasons including local …
This is an auth error. Are you able to generate auth session properly as per the flow mentioned in the documentation?
You can check the python example for the same here.
We are not getting all Subscribed data from ticker at every Websocket tick response
We didn't get you. Do you mean you are getting tick data for only one instrument i.e when here you have subscribed to 2 instruments?
var items = tickerStocksArray;/…
how can we check if the order gets placed or not if we didn't have any order id in our hand
You can look for order_timestamp field in orderbook for each placed order.
it seemed that my code failed to get ticks in the morning today whereas it was running fine till yesterday.
Can you let us know, more about this? Was there any exception thrown? Was there an issue connecting to Websocket connection or only subscribi…
Are you using place_order method to place order above?
Are you getting ReadTimeoutError urllib3.exceptions.ReadTimeoutError:, while placing the above order?
Can you paste the complete debug log for the above request as well?
File "/usr/local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1644, in send
with _from_buffer(buf) as data:
builtins.AttributeError: __enter__
Looks like an Open SSL issue. Can you try uninstalling and installing pyOpenSSL? Follow below step:
p…
Also, you can enable debug log and paste here your complete log for the required request made. Use the below code to enable debug logs:
import logging
logging.basicConfig(level=logging.DEBUG)
As said above, can you paste debug log here? Will help us…
kite.position is showing wrong last price hence wrong pnl data. So is there any other way we can find out the pnl of equity shares traded
You can go through this thread.
kindly tell me what does the average_price mean in an intraday trade.
You can c…
What about simple free products?
As this will still be open to the public, you need to mail with required detail to our compliance team at kiteconnect(at)zerodha.com.
this is giving error TypeError: place_order() missing 1 required positional argument: 'variety'
As the error states, you are not sending the variety param value. You can refer to this documentation to know all the required param for placing an order…
def on_ticks(ws, ticks):
# Callback to receive ticks.
print("Inside on_ticks")
logging.debug("Ticks: {}".format(ticks))
for tick in ticks:
for stock in stocks:
if stock.instrument==tick["instrument_token"]:
…
1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Can you give a complete error stack trace for this?
The above error generally occurs because of some internal exception in your cod…
Are you looking for intra-day period candle data?
If yes, then we have intra-day candle data from 2015 onwards. But, for the day candle, we have candle data since the start. You can go through this thread to know more.
I tried with modeFull and this issue occurs intermittently.
Can you explain more about this? With proper debug logs.
Are you not getting OI field values even in FullMode? Is this missing OI field random with ticks or you observed any pattern?
We jus…
While sl order is triggered, target order must be cancelled and vice versa.
As you have entered two individual orders. You need to specifically cancel other order, when other one is achieved.
As well as cancel order code is entered. but it is not tr…
is there any maximum limits on number of websocket connection using singal API
I believe by singal API you mean single API key.
We allow up to 3 Websocket connections per API key. With each Websocket connection allowing up to 4k instruments subscri…
If I request API for 1-hour candlestick data at 10:16 AM. Can I get it using Historical API for a 9.15-hour candle?
Yes, you can but it's not recommended to fetch Historical data for live market strategies. The historical data API is provided for ba…
I have a csv that contains list of stocks. I wanted to use it in python script directly to get the historical data. But unable to do so.
As @rjamitsharma suggested, there is no direct way. You will have to extract instrument_token from complete inst…
Earlier I was able to retrieve more than 400 stocks using the same code.
We haven't done any changes from our side. You need to review your code at your end.
using local web server to get the request token and then generate the access token. I am ab…
@JitenVerma
We are working on, backfilling all such missing historical candle data for all contracts. It will take some time for this. Once done, we will announce here. Apologies for this.
however, its not working for some reason
Is it throwing the same disconnection error? We don't see any error log for this. Also, you will need to use queue manager(celery, etc) here because of the heavy DB write operations. Check example 1, on the s…
Can someone please confirm if INR 2000 subscription is linked to each Zerodha ID or Per App(Whenever I create a new app I have to pay 2K?).
It's per-app. Irrespective of your linked client_id.
Does it square off the other once as it is the same orde…
Please advise how I can run in debug mode.
You can enable debug logging in your code by adding below code:
import logging
logging.basicConfig(level=logging.DEBUG)
Is there any method using which I can check If a stock had hit lower/upper circuit on a specific date?
No, there is no specific method for this at our end. We currently provide upper/lower circuit limit data for the current day only in full quote AP…
Can someone kindly explain why did shares got allocated from BSE when my order was from NSE?
Your Kite holdings will reflect the exchange price where the previous closing was higher. You can go through this article to know more about this.
Do I nee…
whether i can use single trading code to create three different apps in https://developers.kite.trade/ by paying only one time 2000 per monthly apis?
For each individual kite connect app, you need to pay rs2000 monthly. Kite connect apps are indepen…
'NFO:CE_strike_symbol'
Here, CE_strike_symbol is recognized as string rather than variable. As, you have mentioned it inside string quote. Instead, you may try:
'NFO:{}'.format(CE_strike_symbol)
You can refer to this article to know more about pytho…
is the main() to be kept in the while loop on_ticks() as explained in threading method or below the logging.debug code?
Depends on what you are looking to perform inmain method. If it need tick data as input, you can pass it inside on_ticks() or els…
my_api_key = open('/Users/macdev1/PycharmProjects/SMLogin2/input_data/my_api_key.txt', 'r').read()
my_api_secret = open('/Users/macdev1/PycharmProjects/SMLogin2/input_data/my_api_secret.txt', 'r').read()
Can you re-check on api_key and api_secret f…
We are getting frequent 502 Bad gateway error
Are you trying to download it multiple times without a delay?
If you are facing this issue frequently, you will need to handle this exception at your end. Have some delay and then try making the request…
I am repeatedly getting the same access token and unable to use the same.
Are you sure about using the correct access_token, generated from login flow?
You can go through this thread to about same issue.
print(kite.quote(['NSE:NIFTY']))
Are you looking to fetch quote data for NIFTY 50 indices?
Then, instead it should be 'NSE:NIFTY 50'.
You can fetch complete trading instrument list from here. Look for exchange and tradingsymbol field and use the sa…
BUT, If I call the function at say 9.45 AM then it has only 6 M5 candles for that day and other 14 candles should be from yesterday closing
It all depends on the params you are sending.
You can check an example regarding sending the required param …
1.Does zerodha support paper trading option ? if so how to do it
No, we currently don't support paper trading.
How to backtest the code written using python client ?
You might have to place real order and check. We don't have any in-built functional…
Is there some throttling that has been implemented for my account which is causing this?
There is no limit/throttling for you specifically.
I saw that I was using the default 7-sec timeout which I then increased to 30 sec for the API to work.
Maybe …
Is it possible to cancel an order which has received fill partly, i.e. filled_quantity != 0 but is not complete, i.e. has some pending_quantity?
Yes, you can cancel un-filled pending qty. Go through this documentation.
What is the status of the or…
@kumar_krishnan
I am using kws.connect(threaded=True) and then in another main thread I am calling kws.subscribe(subscribe_list)
It should work properly, if you are assigning required call backs.
Basic example flow:
.......
......
kws.on_ticks = …
Currently, we don't have any function call that returns a boolean flag to check for successful active sessions. You will need to call any API-end point and handle the above exception to know the current active session status. Thought, we will take t…
@pratiks
We went through your above-linked code and console output screenshots. It looks like an issue with your tickerList.map iteration and button attributes assignment logic. As all publisher buttons are rendered properly when individually assi…
I cannot find the python call for it.
You can use order_margin method to make the order margin calculation call. You can refer python example code for the same here.
@akshay07
pressing ctrl+c but its not getting closed the program is running continuously
We won't be able to comment on this until we know your complete setup. It depends on a lot of other dependencies, a few of them like what kind of interpreter a…
@pratiks
const handleClick = () => {
return(
fetch('/ticker').then(res => res.json()).then(data => {
setTickerList(data.ticker);
})
)
}
Can you re-check this part of updating the tickerList state co…
@akash_mittal
val = kite.generate_session(request_token,api_secret=api_secret)
You need to re-check if you are using correct request_token and api_secret values here.
Refer this document for complete flow.
$tillZerodhaFolksWontFixThisGTTBug = ($thisPrice == round($thisPrice));
if ($tillZerodhaFolksWontFixThisGTTBug) {
...
} else {
...
}
This won't fix the above issue. As the issue is while generating URL-encoded query string for POST request. This par…
Place an order via kite desktop (not API), OnOrderUpdate receives the update & tag = `"tfc"`
We just placed a couple of different types of orders from the Kite web and check Postback data. , 'tag': None, is still showing None i.e NULL for all K…
You can connect to be Websocket streaming in real-time. All ticks(including pre-market ticks) are streamed via the WebSockets in real-time, as broadcasted from exchange.
There is no way to get the OHLC data of 2 or 3 sessions in the past.
You will have to use Historical data APIs for this. This is an add-on, you need to subscribe to it additionally from the developer console.
can i set ORDER_TYPE as ORDER_TYPE_MARKET instead of ORDER_TYPE_LIMIT ?
GTT orders are designed to set only LIMIT orders. However, you can use limit orders as a market order by setting the price much above or below the trigger for buy or sell orders…
@akshay07
kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
You should go through this thread to know about above ticker disconnection issue.
In the OHLC Quote, add a field for date
The timestamp field is already available under full market quotes. You can refer to this documentation for all response attributes.
One with today's date and only OHL fields populated and the other with yeste…
what would you suggest as the best time to schedule the OHLC quote call daily in my program... say between 6:30 AM and 9:15 AM (or is it 9:00 AM)?
You can consider a few minutes delta w.r.t exact 6:30 AM and fetch. Recommended time would be 7 AM to …
Also it is referring to oi as a keyword argument which I believe it is not
Yes, oi is keyword argument for historical_data method. You can check the documentation here.
We even tried the same setup as yours(conda, ipython and jupyter notebook) but …
I am fetching data with From Datetime as : 2021-03-24 13:18:26 2021-03-24 13:33:24 then will it give me incorrect data for 13:18 candle or 13:33 candle?
Yes, it will differ. Required period candles are formed, based on your input interval. You can k…
CE14500
Can you let us know complete contract name?
[b=0.0, o=0.0, ltp=248.1 09:55:45:916], [b=0.0, o=0.0, ltp=248.1 09:55:45:916]
Are you using Websocket streaming or Quote call to fetch this?
Give us more detail on this for us to debug further.
tokens.add(Long.parseLong("15495426"));
This doesn't looks like correct instrument token. Can you re-check on this?
Fetch latest instrument list from here.
No, there is no straight forward workaround until you store the daily trade book at your end and do the above calculation for the required contract/symbol.
Package details look fine. What about other API calls? Are you able to make other API calls without any issue. Can you try this latest order margin computation once at your end? Here is an example of the same.