Code snippet below. All the variables are populated before submission to kite. Only one order gave me this issue around 2 pm yesterday. All orders before and after this time executed properly. Can you explain what this 'guid' is when it is thrown?
…
yes atleast in twisted the messages will be lost if a tick is not processed before the next tick comes in.. maybe there is a queue of a few ticks not sure but ticks do get overwritten whenever a user function is busy. On connection re-establish what…
@sujith sorry but I just cant agree with what u are saying. It doesn't work like that at all. No queuing happens at client end atleast not in the way you seem to suggest. Anyway today the market has been extremely volatile and the same code as yeste…
@sujith many thanks.. I didn't realize that the ticks get queued if processing takes long.. I was of the view that the nature of tickers is to fire and forget and not wait for ticks to be processed similar to what happens on MetaTrader systems. I wi…
Well this is setup in AWS. Wanted to know if there was an issue with Tickers at your end.. Looks like if there was you weren't aware of it.. OR maybe AWS was acting up. Anyway its not happening now.. so I am happy to let this go! Thanks!
I have on_error enabled and it is the one that's throwing 1006 connection error.
I have indeed made a ton of changes.
This is happening at random. I haven't had this issue for the past half hour though.
Hi @sbdavra when you say wrong ticks.. do you mean ticks are being missed? I seem to be missing a lot of ticks sometimes price would have moved almost 50 pts by the time a tick is got.. I think its down to KiteTicker disconnecting.. not sure. @suji…
hey wait.. I see some inconsistent data in your instrument dump..
SILVERMFEB20APR20FUT, SILVERMNOV19APR20FUT, SILVERMAR20MAY20FUT
What are the above futs? Such data should not be there. This seems to be a definite bad data.. Can you explain?
kite.instruments is not giving me instrument token for future contracts such as
SILVERM20FEBFUT, SILVER20MARFUT, SILVERMIC20FEBFUT
looks like instrument token for 2020 contracts are not available.
You can try this.
def on_error(ws,code,reason):
message = ("Error from KiteTicker %s, Error code %s, Error reason %s" %(ws,code, reason))
if code == '1006':
# or just write this error to log or any other mechanism …
@neerleo88 I dont think there is much you can do.. this is inherent problem with any websocket. Usually the data loss is less than a few seconds.. you should be able to live with that I think, its very very very rare that huge movements will occur w…
@neerleo88 what I have seen is that Connection error: 1006 - connection was closed uncleanly is very common and is thrown by websocket quite regularly. U may end up losing few ticks but otherwise there is no impact, the websocket recovers by itself…
@sujith @zartimus scratch that post... there are no errors your end. but yeah NSE back end team or some team needs to be kicked as they have changed names of a futures overnight! man who does that in a mid of the month. Not notice nothing.
Have the same issue today on my app as well. App is not able to connect to Zerodha. Login seems ok and token also generated but looks like problem exists with WebSocket. It just exits. @sujith @zartimus can you guys check it up please
@zartimus well I don't have a need for virtual env so not going for it. Well looks like I just may have to now. Strange just recently I had kiteconnect installed in another linux machine without an issue.
Hi @zartimus
Thanks for the inputs but when I try to upgrade requests I get this error.
Collecting requests
Using cached https://files.pythonhosted.org/packages/cc/15/e1c318dbc20032ffbe5628837ca0de2d5b116ffd1b849c699634010f6a5d/requests-2.19.0-py…
@ravhui Check this thread... https://kite.trade/forum/discussion/4032/kite-3-connection-was-closed-uncleanly-peer-dropped-the-tcp-connection-without-previous-websocket#latest..
i had a similar issue i raised query for.. maybe yours is related.
@sujith thanks for the detail. This happened many times on May 21st for place order api - that's the only direct api call i use outside of KiteTicker. But since then i haven't noticed this issue. I will keep a tab though and revert if i sense someth…
@sujith this is a error message at client end -yes - but client here is Kite place_order function not user written code and server is OMS. My question - Is this exception handling added to place_order function in kite 3? I don't think i saw this er…
@hanzo bro.. this kite 3 update is actually a pretty decent improvement over kite 2. The ticker data is far more reliable now with all the timestamps also coming up... i guess your mileage has been different though
@sudhirshettyk I can confirm the behavior that @sujith alludes to. As I see it this error wont go away anytime soon as its to do with a different vendor who most likely wont change his OMS behavior for a border case considering there are only a mino…
so you mean python client (place_order function) of kite terminated the connection when it didn't receive a response within 7 seconds is it? So ideally I could catch this error and retry, correct?
@zartimus My code blocks are the same example blocks you have displayed for KiteTicker streaming. I have a lot of custom code in def on_ticks function though. Anyway I see that when a programming error (error in user code) occurs within the def on_t…
@zartimus yes traceback is printed for errors but previously websocket wouldnt close.
Anyway leave that.. why do you send an on_close event when a new KiteTicker connection is made using kws.connect(). I can see for every new connection i get back…
Gotcha!
Boys you have changed your kiteticker behaviour in the way it handles exceptions. In previous kite version if your code had any errors websocket wouldnt close it would throw error(s) and continue, here it throws an error and on_close event a…
@nahso89 I guess cross currency pairs are not enabled on Zerodha platform as yet.. that's what I understood from the support team when I last checked with them. This could take longer to enable, so you will need to wait till then.
@nickmanan Thanks!
@Shaha - its same pinch to you.. Momentum trading is what works for me too.. remove the nonsense and follow the momentum.. Shhh.. secrets cant be given out!
@sudhirshettyk as I have experienced that is no guarantees here.. after 3:30 pm you cant get details of the order ids that 'didnt' go anywhere.. I guess it gets all purged I suppose.. no traces left behind... a simpler way to sync ur details is thro…
@Sujith .. currency opens at 9 am and commodity at 10 am.., comeon I aint that noob .. the problem is quotes taken very close to open give wrong open price. the kite ticker implementation of providing cached data is worrisome..maybe there ain't muc…
Most frustrating is none of the support even mentioned that Kite migration to Kite3 will break api code. This is ridiculous. Need an explanation here. What were u guys thinking?
Happens for orders placed at 09:00 am. Happened today as well. 180216000015312 .
Situation is like this - I place order using order_place, get order_id and then when I try to retrieve the order to see if it has been executed I get this error - it…
@sujith The ltp is recorded in the system at any given time and mechanism to trade at that price can be provided aint it? No need to bother about bid and ask spreads. Is there a way I can ask this as feature request? I would think this would be fa…
@sujith the point remains as @bluenile indicated.. sending AMO orders not being placed notification is different - even i got that notification and didnt bother. You need to send text specifying that api sesssions have been invalidated and those usi…
@sujith there needs to be some kind of message that is sent to all subscribers on their mobile that such a flush has happened. We get sms when margin exceeds available funds, similarly should get for such events as well. Cant this be arranged? I am …
@sujith whats the update here? Under what condition is 'ERROR FETCHING API SESSION' thrown? I havent seen this error earlier.. seems to be new post v3 rollout.
@tonystark I finally did find it.. it so happened that my code was executing call to quote twice within 1 second and returning the error. Resolved now.
Can you clarify if the one second limit is only for http quote response and not for python q…
@sujith I had the same issue but not for historical data. Happened while fetching quote using http request. "Error fetching API session". Never seen this issue. When is this error thrown?
Aye.. i have. Running algo for a while now. I am able to get 7% return per month on capital invested post all brokerage charges and IT. However i loose all of it or more when i use my brain instead of algo - human tendency!
@tonystark thanks. my requests are well within the limit than. I do only 1 request in 10 mins or so. But still i seem to be hitting this error where i just don't get a quote. I get a simple python error indicating the key data is not present.
this…
@sujith yes I created custom function as @tonystark had indicated. this works but it gives blank quotes and also errors out giving "Too many requests". What is the number of requests limit? Is it per minute? How many?
@Sujith i am still using the old one. Cant move to new one till i make all code changes which takes time. Is there a way i can 'hack' old pykiteconnect to use only the new quote api atleast tremporarily till i move to new one?
@Kailash Thanks. Hope going ahead you make a conscious decision not to change variable names just to set some semantics right. You are now a well known api provider and many algo systems run off it. If every major release leads to big dev cycles fo…
@Kailash @sujith
Kite 3 upgrade is a step in right direction. There are many changes under the hood which is not captured in change logs especially for python apis. I can see a lot of naming changes etc.. this more or less forces a rewrite of all …
Thanks but it seems weird as if bid/ask price is 0.. system should accept any price is place for that script whether it is buy or sell.. but that's not the case.. would have expected a minimum bid/ask price for such scripts where there is volume. So…
Adding on..
Sometimes I have also seen this error around same time. This happens after the order has been placed and order id retrieved and post that I query using kite.orders for that order_id.
Couldnt find that `order_id`
if you haven't subscribed to historical api (separate paid subscription) then you will see this error. Atleast that's what i saw in my case. You cant use this method without paying for it.
@Sujith Thanks for simulating this at your end. Yes this happens during the first 30 seconds on low volume days and extends beyond 9:01 on high volume days. Look forward to your team pre-validating the orders earlier. This will solve a major (for me…
AMO order doesn't do as I take make my strategies based on current market rates. Most of currency action gets done in the first 5 mins and not having ability to track orders at this stage put paid to any strategy used. Hope to get a speedy solution …
@Kailash
Kudos for #3 Release. Thought not much of an impact for me as I don't use postbacks for now. I am more interested in #4.. that seems to have some real good features - primarily position updates via WS. What is the current timeline for #4 r…
@sauravkedia @sujith thanks for your response.
the python api gives the values as dicts and its pretty easy to work with atleast for my use case. Looping through the nest can be a problem.. I just get my data as this -
based on what @sujith said…
ok thanks. I wanted to be able to get the buy / sell prices for the same script taken at different rates. I guess the instrument token and average price will have to be do for now. You can close the query! Thanks.
Hi
Do update if there is a problem with the quote api for python client. I read another discussion where get_quote was causing a problem since 26th Sep. Not sure if these two are related. Do update.
Thanks
Ravi