@sujith Can you please provide an example of what changed, I didn't fully get that. And it'll be helpful if you could do this on a sunday so that we can test it before moving to a live day
Of course, all that matters is the kite object. Different classes can be seen as separate programs and you can have a master class that calls a function in the separate account's class objects with different ids
import dill
file_to_dump_file = open(config.KITE_OBJECT_FILE, "wb")
dill.dump(kite, file_to_dump_file) # kite being the object you set access token to
file_to_dump_file.close()
Store it like this after loading the access to…
@enliyo I collect the order book to make sure that order is placed like I expected(quantity, type, etc). I know this is a bit much but I try to leave no room for errors. Also there could be network issues when waiting for socket push, while if there…
I had the same issue today. I got notification in mobile and web only after market closed. The order book is working correctly, it's only the notification that has this issue
You can get connection errors at times, that's why you need to have error handling code (try, except) for when this happens. If it cannot be handled automatically, you should set up an alert system like an automatic call to your phone so that you ca…
Without threading it takes about 0.6s per order, with threading stay within the below limits. Make sure you confirm if your order is placed by checking with the order list
# Request limits:-
# Quote API - 1r/s
# Order place API - 5r/s
# Historical…
Don't rely try on API for things like this. This API doesn't provide an option like this anyway. Use timestamps like below
# Market opens at ---------------------------> 09:15
# MIS auto square off at --------------------> 15:20
# Market clos…
This is not a subscription issue. Call this function and see it's result
kite.instruments('NSE')
You'll see a dict of stock names and token_ids. You need to feed the token_id that corresponds to the stock name to the instrument_token argument
Not sure exactly what you call wrong, but, I guess you are meaning the last trade time being 3:59PM, but, market closes at 3:30PM. This is because of post market session. This is active from 3:40PM to 4:00PM. The price at this time is fixed to the l…
Pretty much any function that you can do manually can be done using the API, except for things like exiting all orders in a single go. So yes, you can do it
From my experience,
except (kiteconnect.exceptions.NetworkException, kiteconnect.exceptions.DataException, requests.exceptions.ConnectionError):
# Handle network exceptions it here
except kiteconnect.exceptions.InputException:
# You get this w…
You can compare the current date with the dates returned from this function. and check for if the current day is sat and sun and stop trading accordingly, this is how I currently do it. You can update the holiday list every year
def holiday_list():
h_list = open(config.HOLIDAY_LIST_FILE, 'r')
holiday_list = []
for i in h_list.readlines():
if i.strip() != '':
holiday_list.append(i.strip())
return holiday_list
Lol yeah, it's sad that we have to log in everyday, apparently it's a regulation by the exchange. Not sure why this exists like the countless other useless regulations that exist in our country :P That's not a reason to not use this API, you'll prob…
1) I'm sure this is the limit, there have been many users that have complained that they don't have enough orders
2) You need to manually log in at 7AM or 7:30AM(not sure about this) and store the object locally using pickle or .dll file. This will …
I've been able to access things like prices, historical data at all times, but, account related stuff doesn't work after 1:25AM until about 4 to 6 AM. After that, it works normally
As a risk management measure, at Zerodha, a single user will not be able to place more than 2000 BO/CO and 2000 NRML/MIS/CNC/AMO orders per day. This restriction is across all segments.
There are also limitations at 200 orders per minute and 5 orde…
https://pastebin.com/iRP1r86P
This is a very simple function to cancel all orders. This is in python, but, you can refer this to make it in node js too
Always have a retry system which tries atleast one more time if there is an exception for any API as a general rule. You should always expect network issues when dealing with things like this and have a backup plan. I'd also advise you get the order…
Host it in a web server. Any disruptions in your ISPs internet connection or your hardware can cause you to lose more money than what you pay for on servers. On hardware requirements, since I don't know about your scripts, see what's the most amount…
from twilio.rest import Client
import credentials
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
client = Client(credentials.account_sid, credentials.auth_token)
def make_call(voic…
I faced the same for ohlc daily data today. Limit was reduced to 2000 days. There is no mention of this even in this forum. I'm fine with this change but such sudden shocks are not right in a system which is supposed to help with automation. Until t…
https://kite.trade/forum/discussion/5698/we-need-an-email-notification-list-for-any-detected-issues-changes-in-the-api#latest
I've been asking the same thing...
I see that you have taken initiative to alert about corporate actions in this link,
https://docs.google.com/spreadsheets/d/1-_NV8XPKZ_qg-R24fjQfTzSbJT3jhvTuc23xfgcDjg4/edit?ts=5927cbaf#gid=0
But it doesn't seem to be up to date
You'll know what to do by simply running this command
print(kite.orders())
or
for order in kite.orders():
print(order)
You'll be able to see all the details that you see in the kite website, including the number of stocks left from your orde…
The devs recommend websockets, I don't use this, but, you can do more research on this
To get simple ohlc info, you can use kite.quote([stock1:exchange_name, stock2_exchange_name...])
Above function will take in an array of order ids and return which orders are successful and which ones failed as a dict
{orderid1>: True/False, orderid2, ............}
Enjoy!
There was another mismatch today,
JETAIRWAYS was banned from MIS, but, it is still in the margin allowed list. Please update this list atleast once in a day
There have not been any major changes/issues recently and the API has been working with no issues for a good amount of time, but, I think it's better we have some kind of notification for any changes made. We use this API in the assumption that it h…
print(kite.margins())
The above command worked till 1:30AM, the I get a kiteconnect.exceptions.GeneralException: Get Rms Limits Entity Response : Request not registered
Similarly, the AMO that was placed now did not appear in the order book
@sujith If you try making any API calls at 1.30AM to 3.00AM, You'll get random messages, I don't have the traceback, I'll provide it next time I get it, but, you should be able to check on your end too
@sujith We cannot check the forum every day, that's why it would be optimal if you could provide at least a simple email notification saying that changes have been made
The real amount you can use for any trades is the value in 'net' or 'margin available'.That's the real balance you have left to use for trading.
The account value or cash is the amount you can withdraw instantly to your bank account
The "Margin available" is the amount left available for CNC or any other use. The "Margin used" is the amount used for your current interday positions. Regardless of the outcomes of your trades, your account value number only gets changed overnight.…
repeat DELTACORP
repeat HEIDELBERG
These 2 stocks are present in both available and banned list. Some stocks that were in the allowed list was blocked anyway by their RMS when I placed the order. This has to be looked into
kite.margins() # returns all account-related data that you see above in python
If a stock ABS has 2X margin and you buy one share of it in intraday for 100rs, only 50rs margin gets used from your account
IMO experimentation is required, but, the least they can do is inform us! It's not right that we have to see this site every day to look for any changes!
Margin list was correct for the past month as far as I've seen. Now, the list is wrong again.
PRESTIGE:EQ
This was barred from MIS trading with the message but is still in the list
MIS / BO / CO orders are blocked for this instrument (try CNC / NRM…
https://kite.trade/connect/login?api_key=
Use the above link to log into your account, after which you should be getting a request as part of the link it's redirected to. Use that token to generate a session. Using the equivalent of this call in yo…