MAG

About

Username
MAG
Joined
Visits
1,732
Last Active
Roles
Member

Comments

  • @KamalChhirang Which api call gave you this error? You were fetching prices so I assume it was the kite.quote() call. Also how many requests were you making per second/minute? Just curious to know some details and will see if I can replicate at my…
  • Download the latest instrument list and check if the symbolname is valid in the instrument list. ITC,30818818,120386,0.0,NFO,ITC24JUL360CE,0.05,360.0,CE,NFO-OPT,2024-07-25,1600 the expiry date for ITC24JUL360CE was 2024-07-25. Current near month …
  • Working fine at my end. And no one else is complaining either. So it is most probably an issue with invalid access token or unstable internet connection.
    in Connection Error Comment by MAG July 30
  • ITC24JUL360CE is an options instrument so it has to be NFO instead of NSE. This is absolute basic information/knowledge.
  • AFAIK going back to a few years, for indices the instrument type was always 'EQ' and segment was 'INDICES'. And if I wanted to parse the instrument list for indices I always used the filter segment='INDICES'. So there has been no recent change. Ju…
  • @pranit0405 @sharma1291 Your code needs to be aware of the API limits and have controls in place to ensure that the limits are not being exceeded. Are you having any mechanism in place to monitor and preferably even log the requests made and the…
  • Sorry, I don't have the time, bandwith or patience to read and correct other peoples code. I can tell you what to do and then you need the required programming skills and experience to figure things out yourself. The only thing I will say is this. …
  • def on_ticks(ws, ticks): # Callback to receive live market data # print(dt.datetime.now()) for json_data in ticks: try: token = json_data["instrument_token"] symbol = self.contract_token_map.loc[token, "TradingSymbol"] if('exchange_timestamp' in…
  • @kakush30 The problem is that they want ready made solutions that fits their wish-case. Writing their own code is too much work either because they do not know programming well enough or they do not want to put in the effort.
  • @sujith @rakeshr @Kailash The fact that it was rectified is not enough. Isnt there any monitoring/checks before market opens to ensure that all services are working fine? Today it was 9:19 when I finally was able to access the developers console a…
  • @sujith is there are update on this? What happened and how can this be avoided in the future.
  • Just started working. Lost the first few minute ticks.
  • You have to get the latest instrumentlist and then write your own logic/code to filter through the instrument list and extract the data you need. There are no ready made shortcuts available. For filtering the data you can either use a programming la…
  • "message":"unknown Authorization scheme" - your authentication is failing. The instrumentlist api call will work even if authorisation fails as it is public data and not specific to your account. In fact that's the only call which will work with o…
  • @srinidhihebbar You have tagged me but you haven't included any concrete data which can help me or any one else determine the issue. First you say there are missing ticks. How did you determine that the ticks are missing? Also Is it for some ins…
  • Both MAG and sujith are right. Problem is in your lack of understanding or unwillingness to understand. Let me explain but I will keep it short. Sujith said that the features you want like disable trading after certain loss, only allow 4 trades pe…
  • First of all don't you know English? You seem to be reading our answers fine. I find the hinglish irritating so if you continue using it, I will stop responding. Everything you want can be done. But you need to write the code to fulfill those cond…
  • One crude but effective way of enabling the equivalent of a kill switch in code is to invalidate the access token. example If loss > 10000 : This method can apply to any condition you want to set, limited only by your imagination and codi…
  • User user = null; user = kiteConnect.generateSession(reqToken, apisec); kiteConnect.setAccessToken(user.accessToken); kiteConnect.setPublicToken(user.publicToken); user = kiteConnect.generateSession(reqToken, apisec); kiteConnect.setAccessToken(us…
  • The instrument list is public information and hence the kite.instruments() will succeed even if you are not authenticated. But to get any other account information or place /modify orders authentication is needed. Instead of using the kite.instrume…
  • Fair enough and I apologise. But I would like to point out one factor that many people miss. That kite web is separate from kite API. And any feature available on one might not necessarily be available on the other.
  • Is this related to API or kite web/mobile interface? If its related to kite web, you would need to create a ticket with support. And then yes maybe you can post a link to the ticket here and tag one of the devs/moderators to bring it to their atten…
  • Please do not give wrong answers. The most important part of @visasimbus post is the following line Is zerodha kite connect python client has implementation of ticker to get positions when there is a change in position? And the answer to that is a…
  • It answers your question but you do not want to hear it. Sensex is BSE Index/FNO. It clearly says that in BSE icebergs are available for equity only. F&O is not mentioned. So the answer is no for sensex. Same for bankex (BFO-OPT) Everything ne…
  • No you cant do that. The order limits are set at the account level and not the app level. so whether you create one app or ten, you can still make only 10 orders per second, 200 orders per minute and 3000 orders per day. The other api calls like hi…
  • @vaibhavsharma13 please read the FAQ section. It's mentioned there.
  • You will need to run three threads using the threading or multiprocessing modules. However using a single python client to make multiple connections to websocket is a bad idea. This approach just increases the code complexity and the chances of thin…
  • Read the first four pinned posts on the forum. 1. Changes to per day order limits 2. FAQs on Pykiteconnect(Specific to python client) 3. Frequently asked questions(FAQs) 4. A curated list of things related to Kite Connect API Out of these number 2 …
  • @OptionQuant Thanks for such a detailed reply! And, I forgot to mention that all timings in my query are as per 24 hour clock..so for instance by 12:15 am I meant 15 mins past midnight. Some people refer to midnight as 12 as the clock shows 12. But…
  • Many of us here have entire algo setups with code running in the backend doing everything from getting ticks from websockets, computing candles, running strategies and trading/order placement. Some of us also have real time monitoring / reporting of…
  • I would suggest that you try connecting to websocket using backend command line code in the language of your choice - preferably python as its the easiest for anyone to pick up whether someone is adept at another programming language or absolutely n…
  • @OptionQuant Noted - the reply is again involved so will reply by EOD.
  • Disclaimer: Not part of zerodha team but a API user since 2016. They have mentioned in the FAQ's that access tokens are flushed sometime between 5 to 7:30 am everyday. What I have determined from personal experience since the past 8 years is that …
  • All I would say in response is if you are new to api based trading then spend some time to read the documentation and FAQ's carefully. Most of your queries would already be answered there. Then when you start coding, look at sample code and first st…
  • How did you determine that the value for tradingsymbol should be MCX:CRUDEOIL24APR7100CE? Read the documentation carefully. When you ask for a quote the symbol is given as "exchange:tradingsymbol" format. Thats because one can ask for a quote for m…
  • The kite web UI and the API are two separate things. Just because you see something on the web UI does not mean it will / should be available in the API. The API is simple building blocks where you can build any functionality you want. In this cas…
  • Just looked up Quantiply. Quantiply does not seem to support zerodha either officially or unofficially. Either way even if it was supported, you would need to contact them about any issues with their service.
  • You have to use the kite ticker websocket api to get the ticks, process the ticks and compute this or any other detail that you need.
  • Nope! Check the instruments list at https://api.kite.trade/instruments. That contains all the instruments provided/available.
  • @algos Why cant you give details out here itself. Whats the idea behind trying to get people to join an external telegram group? @sujith probably you need to have this conversation internally about contact harvesting on the forums which can be used…
  • If you don't know about the market please learn how the markets work. Understand each component of data and order details well before you start dabbling into API based trading. You can't build a building without having a solid foundation. Similarly …
  • No idea about that. I think you would need to have an official tie up with Zerodha. Some folks do it without a official tieup too but doing so violates multiple SEBI directives. kiteconnect as well as any other broker provided API is designed only …
  • @nikhilds That depends on how you generate your access token. Many people try to automate or semiautomate the flow and in that automation they end up opening a new browser window for kite which logs out the previous session. Keep this simple thing…
  • RTFM, go through the FAQ's and you will realise that there are ratelimits for api calls. You need to maintain the rate limit. The simplest way of achieving this is to have your code sleep for some time between subsequent requests. Please go through …
  • On having a closer look at the screenshot in your first post I see the key as "Authorization" and value as "token api_key D2eho..." when it should be "token api_key:D2eho..." a :(colon) instead of space after api_key. RTFM and copy and paste examp…
  • @swapv18 The instruments call with go through with or without authentication. So the fact that you get the instruments does not mean that authentication worked for the instruments call and is failing for the rest. Another way of saying this is that…
  • @arijit101 Btw this is the link to the comment containing the code. https://kite.trade/forum/discussion/comment/44453/#Comment_44453
  • @arijit101 Also all the formulas are known. You can write your own methods to calculate the charges. I have some post here where I have shared the entire method definition for computing costs. Look it up If you copy that code as is and call it wi…
  • Yes and which is why many of us here run our code on the cloud using AWS/GCP/Azure.
  • Code was working fine till last week and the present week I have been travelling. When computer sleeps after sometime, I get a read timeout error. You clearly were not on your original home network when you originally posted this. You said you are…
  • @mb12 were you trying this out yesterday/today? Your post date is March 16. The second post is today morning. How do you expect to receive market quotes when the market is closed?
  • @gurpreet Thats a library written by someone and made public on the internet. You will have to contact the person owning that library for support. It has nothing to do with zerodha. Also a quick perusal through the code showed at least one severe …
  • Where did you get the line kite.option_chain('NSE') from? Can you post a link to the source? Kiteconnect official api and clients do not have a call for getting option chain. Or in other words a ready made option chain is not available for downloa…
  • @abhi_shah was it a market order? "4. Market orders in all segments will be blocked for the first two minutes of both sessions." from https://zerodha.com/marketintel/bulletin/371327/live-trading-session-on-saturday-march-02-2024 And wonder why your…
  • @Matti Thanks for the update and the link to the circular.
  • Same here python client gives the ticks as a list of dictionaries instead of individual ticks like in golang. And I get an average of 100 ticks per minute or 37500 (+-0-10) ticks per day. And this has not changed in the last few days.
  • You have to write your own logic for this. From 9:15 to 15:30 is 6.25 hours or 375 minutes So at EOD after market close if you want last 1000 candles of 5 minute interval that would be 1000/375*5 = 13.3333 days worth of data. So you would get data …
  • @zerodhaVyankatesh There are N number of ticks per second depending on the liquidity of the instruments. I don't know whats the average but I wouldn't be surprised if a very liquid instrument has hundreds of ticks per second at the exchange level. …
  • @zerodhaVyankatesh The OHLC information will never match exactly as we get a subset of ticks from the exchange. As long as they are close, you shouldn't worry. Right now I don't do comparisons. But when I started out, I used to do so and they were a…
  • @pareshbhatiya What programming language are you using? How are you trying to get the quotes? Are you using the websocket or are you using the kite.quote method/call? Without proper details how do you expect anyone to guess whats going on at your e…
  • @vaibhavsharma13 your comment is incorrect. @khalid kite.ltp API call only returns the instrument token and last price. - Check the documentation at https://kite.trade/docs/connect/v3/market-quotes/ or https://kite.trade/docs/pykiteconnect/v4/#k…
  • Check this thread for reference. https://kite.trade/forum/discussion/comment/45901/
  • There was no issue at all. How were you searching for the banknifty instruments? Are you creating symbol names on your own or referencing them from the instrument list? Thats a common mistake many people do. I think you might be making the mistake …
  • @trd1 Ok. Have you tried getting the tickdata, generating candles from that data and then comparing how it fares. Or candles from other sources like tradingview or kite web or Investar?
  • Absolutely no idea about the 3:05 candle. But then its the 'historical' data api. Its not supposed to be used for current day data and esp for any live trading. Again as said earlier, I am not a member of the zerodha team. I am a long term user of t…
  • This should answer your query. https://support.zerodha.com/category/trading-and-markets/trading-faqs/articles/ltp-doesnt-match-close A somewhat similar logic applies to open price too which is why many users complain that the open price has changed…
  • First of all - your systems should never run on local time. They should use NTP to sync their time to reliable NTP servers. Second, if you want minute level candles for live data, the only reliable way is to use the kite ticker to subscribe to the t…
  • Refer to my understanding of the topic based on discussions in my circle. https://kite.trade/forum/discussion/13704/sebi-banning-api-based-trading#latest This is all due to 1. Unregulated fintech companies providing algo trading as a service. 2. …
  • If you are new here, please spend some time going through the forums. This topic has been discussed multiple times and there is a very specific reason the access token validity is set to one day. All the information is out there in the faq's and fo…
  • @naveen278 I am not part of SEBI or even Zerodhas team. But I have spent quite some time reading and researching this topic. My learning and common sense tells me that if you want to provide a service where you provide the algo but it runs on indivi…
  • Such kind of forum posts are not useful to anybody. What do you mean when you say "i am not able to fetch request token even if i have bought the interactive api from developer.kite". The request token is returned when you send a http request like…
  • Any idea why these prices keep changing? Are you getting the current days live data?
  • @Mr_rajatmishra the documentation is clear - if the documentation shows instrument_token then thats what you need to provide in the api call. Computers and programming are very specific. If a system/api is designed to take instrument token as input…
  • Read the heading carefully - "algo platforms and strategy providers" You are mixing up things. There are individual traders using the api to trade. And then there are these so called algo trading platforms and algo trading strategy providers who pr…
  • Its been absolutely stable at my end for last few days. And if there was an actual issue, there would be a lot more folks complaining on the forums. It's either to do with your code or your internet connection.
  • From my observations it can be anything from 30 seconds to a few minutes. Historical API is meant for backtesting. It's not meant for intraday or live trading though many users try to use it for that purpose. From Zerodha's point of view, getting …
  • You get all index details at NSE website - https://www.nseindia.com/market-data/live-market-indices Click on any index name to get the details For eg, I scrolled down and clicked on Nifty Auto under sectoral indices which got me to this link https:…
  • There are multiple things here which i need to go over one by one so I will give a proper detailed response later in the day after market close.
  • For those complaining about 504 errors, I assume you trying to make the kite.quote API call again and again multiple times in a continuous loop. Is that right?
  • @r95990 the only way to properly debug this is to print a tick as its received by on_ticks and then print the very same tick passed on to the feed_data method. In order to format the output better, add the following lines to the beginning of your fi…
  • @sujith When the tokens are cleared, can there be an additional check for age? If one wakes up at 5 am and create a new access token for the day, ideally, it should not be cleared at around 6:00 am.
  • I have coded in my algo that for last day of expiry on any given month is considered as monthly expiry. If it is monthly expiry symbol formation is different. Due to which it got broke. Now i am not sure how to take it forward in future to handle th…
  • same browser, same session, 6-8 kite tabs Can you walk me through the flow. If I understand the steps you take, maybe it will help me spot a probable cause for this issue.
  • @r95990 'mode': 'quote' says it all. You need to change the mode to full. In quote mode you will not get market depth. in your on_connect method you would first subscribe to the instrument tokens and then set the mode to full as follows def on_con…
  • when I open multiple bookmarked tabs at once, it logs me out of all the sessions on kite web @pseudo Are these bookmarked tabs in the same browser and browser session? How many tabs are you opening?
  • If you read through the documentation and the pinned FAQ's you would have realised that this is by design. The exchange mandates that each user needs to log in manually everyday that they are trading. So if a user is allowed to call https://kite.ze…
  • it started running fine after some time without any change, and the error was random when i ended up sending wrong strikes to quote Ok, but this means there is some logical error in your code that is unresolved and could come back to haunt you late…
  • This is an error in your code. However without a debug trace or looking at your code, no can determine whats wrong. There should have been an accompanying line before this mentioning the line number where this error occurred. But this is definitel…
  • Today is BANKNIFTY weekly expiry for the last week of January 2024. BANKNIFTY monthly expiry was on the last Thursday of Jan 2024 i.e. 25th Jan 2024. The logic is simple - till date for BANKNIFTY, the weekly expiry is every Wednesday. Monthly expir…
  • You can try that - but there are no guarantees it will work. We have no idea whats going on with your broadband internet connection other than the fact that its flaking. And most home broadband connections are like this. They will have temp conn iss…
  • Login flow i.e. data = kite.generate_session("request_token_here", secret="your_secret")needs to happen just once a day in order to generate the access token. Once the access token is generated you can save it. And then you just need to initiate th…
  • Are you running this on a home broadband connection or on a cloud/datacenter server like AWS etc? If its home broadband, its probably an issue with your broadband connection flaking.
  • mode': 'quote' Try setting the mode to full. I use the full mode and I get timestamp as well as last trade time. I havent tried but I think in quote mode timestamp is not sent. I remember reading about this on some other thread.
  • In the python client each tick received is a list of dictionaries as denoted in https://kite.trade/docs/pykiteconnect/v4/#kiteconnect.KiteTicker. Scroll down and search/look for the section below the line "Tick structure (passed to the on_ticks call…
  • Can you use one access token on multiple machines? yes. Can you use one access token on Multiple algo providers like tradetron and quantiply? Yes. But its definitely not a good idea. Unless you have a way of ensuring one app does not modify orders …
  • I can help you. But before I do, I need to know your background. Can you answer each of the following questions. 1. Are you an active trader/investor? 2. If yes, How long have you been trading/investing in the markets 3. Do you have programming expe…
  • You need to log in manually everyday. Thats an exchange mandate. And everyone here does the same. The only variable that varies everyday is the request token which needs to be generated manually So what you can do is script it up such that it prom…
  • @vishwas This is not possible via the API. For this you have to generate your own maps based on data from nse website in the market data section https://www.nseindia.com/market-data/live-market-indices
  • 403 forbidden is an access denied error. Has your api app subscription expired or are you using an expired access token?
    in Login issue Comment by MAG January 4