@girish400 @nickmanan I am able to subscribe and get ticks with full mode. Please check if your callback code is fine. I will setup Anaconda env and check there also.
I wouldn't suggest you to wrap the logic with try except block because once you do kws.connect( threaded=False, disable_ssl_verification=True, proxy=None) current thread is blocked and there won't be any exception raised even if it's an error in you…
Timestamp is a python datetime object and when you print dictionary it's formatted like this. You should ideally be accessting the timestamp object to get seconds.
Since there is a rate limit to quote calls you can't call it more than once a second. So please update your logic to fetch price once a second only else you can use WebSocket to get live ticks.
Since its installed as egg your site-packages folder will have egg `kiteconnect-3.7.0b9-py3.4.egg`. This shouldnt be a problem to you since you can import and use Kiteconnect just like any other library.
@eeesathiaeee As said before you shouldn't be calling get access token call from frontend. Its should be implemented in backend and your frontend should talk to your backend to get data. Otherwise you will compromise your api secret and also access …
If it existed earlier, has its placement within the response string changed.
Order of keys in query params shouldn't matter. Any url parsing library will parse this and gives you a map so order doesn't matter.
Is it in your control which parameter…
@trade_then Action is a new query arg which we sent to identify the type of connect login attempted fox example login, basket etc. Your app should ideally be parsing the query args and check values for only the keys which you are interested in and s…
@ZV4555 As per docs instruments is a args param so you can pass your instruments list as
self.kite.quote(*instrument_list)
or
self.kite.quote(instrument_list)
Have you checked this in docs? - https://github.com/zerodhatech/pykiteconnect#microsoft-windows
You can also download the .zip file and run `python setup.py install` manually.
Kiteconnectjs is a node client and can't be used in browser. Its possible to modify it and use it in webpage but you still need a backend server which will handle things like access token exchange.
@pandithurai, Please read Kite 3 documentation - https://kite.trade/docs/connect/v3/
1. The endpoint is same but you need to send version via header
To request a particular version of the API, set the HTTP header X-Kite-version: v where v is the ver…
@nikhil154 If you want one minute data then you might as well form candle yourself by consuming websocket ticks. For example in Kite charts we pull historical data till last minute and form live candles based on live tick.
@Shaha Seems like issue with Windows only under certain circumstances. You can see that we have tested this in most of the Windows environment including Miniconda - https://ci.appveyor.com/project/rainmattertech/pykiteconnect
You might have to rein…
@RP3436 Can you try installing with ANACONDA prompt opened as administrator? Also before installing can you run this and check if it goes through?
pip install https://raw.githubusercontent.com/zerodhatech/python-wheels/master/Twisted-17.9.0-cp36-cp…
Seems like issue with your implementation. I have tried the same and got the connection closed cleanly. Here is the logs with debug enabled
2018-03-09 11:40:46,959 - kiteconnect.ticker - DEBUG - Start WebSocket connection.
2018-03-09 11:40:46+0530 […
Seems like you are trying to format a string in your callback without any argument. So basically if your logic is wrong in callbacks it will be raised like this.
@RP3436 Seems like this is an issue with Conda environment. Please try the following before installing
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
conda install -q wheel
python -m pip install --ignore-in…
Seems like your `on_tick` callback is wrong. It takes `ws` WebSocket object as first param and `ticks` as second param. Check example for reference - https://github.com/zerodhatech/pykiteconnect#websocket-usage
Please update to v3.7.0b8 where I have added a method called `stop` to stop the main thread. Also note that now if you call method `close` you don't have to call `stop_retry` since its implicitly disabled. Here is a modified example
import logging
f…
@RP3436 Can you please try installing again. We had made some changes to setup.py for installation issues in Windows. We have tested this in different envs on Windows and verified it works fine - https://ci.appveyor.com/project/rainmattertech/pykite…
You will get all these values in positions response itself. For example
"net": [{
"tradingsymbol": "NIFTY15DEC9500CE",
"exchange": "NFO",
"instrument_token": 41453,
"product": "NRML",
"quantity": -100,
"overnight…
We haven't noticed anything odd in our side, please check if you have subscribed to liquid scrips , its possible that for some illiquid scrips you might not get initial ticks also. Also you are trying before market so make sure you try during market…
You got the error because In BSE the tradingsymbol is called NILA and not NILAINFRA (https://www.bseindia.com/stock-share-price/nila-infrastructures-ltd/nila/530377/)
I think you have named your script file kiteconnect.py so its failing. Also you should be using the latest version - Kiteconnect v3. Please check this forum post - https://kite.trade/forum/discussion/2998/upgrade-to-kite-connect-3-0#latest
I am afraid thats not possible. You should be placing multiple orders with different limit price. Downside here is your margin will be blocked for each order.
Can you please update your package to version 3.7.0b5? Just added error logs which will show the actual errors instead of internal errors. You can update via pip
pip install kiteconnect --upgrade --pre
@pracas Can you please paste full logs? Check if you have an log like this
2018-02-07 11:15:36,673 - root - ERROR - closed connection on close: 1006 connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
If yes then …
@Jignesh Seems like some non https file is loaded while loading Kite3.zerodha.com. Can you please check in your network tab which file is causing this issue?
This seems to be the same issue as others have reported in this thread. You can followup here - https://kite.trade/forum/discussion/3235/websocket-intial-tick-not-received-for-all-instruments#latest
If you are facing new issues apart from anything …
1. You can send more than 500 instruments now, this has been fixed in backend
2. We have increased the limit for now but while announcing migration deadlines we will specify the rate limits for this as well.
1. Same KiteTicker instance shouldn't be used in different threads since you can run only one twisted reactor instance hence you get error `twisted.internet.error.ReactorAlreadyRunning`.
2. When more than 500 instruments are subscribed the message l…
WebSocket uses same port as SSL which is 443 so port shouldn't be an issue as long as you can curl an SSL site. You can enable debug by setting flag while initializing
kws = KiteTicker("your_api_key", "your_access_token", debug=True)
@sameer I think it reconnects automatically after you close. Can you try manually stopping retry before you close. Something like this
def stop_gracefully(self):
self.kiteTicker.stop_retry()
self.kiteTicker.close()
Please share more info about the issue
1. Which client library you are using?
2. Set debug mode in client library and get logs
3. Are you using Kite 2 or Kite 3 API clients?
Yeah when you create a new app you pay Rs.2000 for that also but advantage you get is you can use different Zerodha client id's than your first app since one app is tied to one Zerodha client id.
You can use same api_key (one app) for running any number of strategies though user id will be same user linked to the app. Since we are in migration phase we haven't restricted number of websocket connections allowed but once we announce deadlines …
@sameer Tokens are list of integers. I just subscribed for all the tokens given and it works.
[1510401, 1270529, 225537, 3861249, 2672641, 633601, 356865, 6401, 70401, 215553, 492033, 5633, 2714625, 325121, 60417, 1850625, 1346049, 3771393, 54273]
@ansumanm on_message callback is to get all the data received without processing it. By default binary data is processed and sent parsed data in on_ticks callback, similarly text data is parsed for order update and sent in on_order_update callback. …
Are you doing something in on_tick callback? If yes then can you please share the logic. Seems like you are closing the connection everytime you receive tick. Also please share the full logs with debug flag True.
You need to have a server for this, with just Kite publisher you cannot do that since you need to post data to a endpoint. Your server will create a unique url which in turn post to Kite connect basket endpoint.
@Shaha As given in documentation you can post to basket endpoint with your payload. So in your case you can create a unique endpoint in your server which will in turn posts to basket endpoint.
@nickmanan Seems like you are trying to run it twice but ideally once you run it just blocks the current thread. Can you please try the following example and check if it runs?
import json
import logging
from kiteconnect import KiteTicker
logging.ba…
@RajeshSivadasan You seem to be using old version (Kite 2)
Please check latest documentation here - https://kite.trade/docs/connect/v3/ and latest Pykiteconnect release - https://github.com/zerodhatech/pykiteconnect/releases/tag/v3.7.0-beta1
I would suggest you to have your own map of exchange timings and act based on that. Closing connection after market is not an ideal solution but there can be callback with market events but currently we don't have any idea to implement.
@bluenile Seems like Python 3 unicode related issue where the value is type bytes instead of string. If you can get me full traceback it will be useful.
@evolutioncage As @sujith said it depends on how liquid your scrips are and what mode you have subscribed to. If we assume you get tick for all 50 instruments every second and subscribed to full mode then it will be around 231.84Mb for 7 hours.
@sushanthrd Example in README is fixed now - https://github.com/zerodhatech/phpkiteconnect/tree/kite3#usage
You should be passing param variety as first param and then other option inarray like below
$order_id = $kite->placeOrder( "regular", […
You can get instruments from `instruments` call in Python client. Here is a documentation - https://kite.trade/docs/connect/v3/market-quotes/#instruments
You can use same client id for multiple apps but when you fetch orders you will get all orders for that client id. To get around that you can make use of field called `tag` while placing order which will be returned in orders response and you can fi…
@bluenile I just tested the scenario and it works fine. on_tick callback I was placing a market order and as expected order went through and I also got on_order_update callback.
Here is my log
2018-01-22 12:16:59,727 - root - DEBUG - on connect: {"…
I just tried with same symbols and it works
kite.ltp(["NSE:INFY", "BSE:INFY"])
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /quote/ltp?i=NSE%3AINFY&i…
This was an issue with initial release. Its been updated since then. Please pull the latest code and try again - https://github.com/zerodhatech/phpkiteconnect/tree/kite3
Also you should be passing instruments as an array like below
getQuote(array…
This was an issue with initial release. Its been updated since then. Please pull the latest code and try again - https://github.com/zerodhatech/phpkiteconnect/tree/kite3
You can send custom tag to your orders placed via api which will be returned back as tag field in orders calls. Check documentation for more details - https://kite.trade/docs/connect/v3/orders/#regular-order-parameters
I just tested your script by replacing `request_token` with request token I got from my app and it works. Here is my code for your reference. Please check if you are passing right api secret and request token