Also, don't use threaded=True when connecting websocket if you don't need it. Otherwise,you have to use a infinite while loop to re-define the functions and assign callbacks. And websocket.connect() should be after assigning the callbacks not just a…
@rdhingra I just checked. This api is working for me. What's the error you are getting??
To download csv file directly,you must add /NFO suffix as told by Rakesh Sir.
The sl order was placed simultaneously with target order at 9:25:36. The orderbook is showing sl 33 min after target order beacuse it was modified at 9:58:11. And its showing the most recent time it was modified. There is no issue from zerodha side.
Are you using the kite.set_access_token function??? If you want to reuse access token in another script,you must save the access token in a variable and use set_access_token function.
What's the start date you are passing?? Beacuse this contract was last traded on 18/11/2021 at 11:22:33. In kite web and app too,the charts are empty. You must be passing start date after 18/11.
Yes,you can save data at your end through websocket every day and calculate all indicators. But,this is very hard and you can only calculate indicators from the time you start. If you want to backtest,you have to buy historical data. Also, if any er…
@raptron In the tick, instruments are identified with instrument token rather than trading symbol. You can specify the instrument token of the instrument you want to extract its data from the ticks. Read here:
https://kite.trade/docs/connect/v3/m…
Ticks is a list of dictionaries. You can use python methods and functions to get your required data from the ticks. You can see sample tick structure and all about KiteTicker here.
https://kite.trade/docs/pykiteconnect/v3/ticker.m.html
You can subscribe up to 3000 instruments/shares in a single WebSocket connection, and for single API key you can have 3 WebSocket connection, so you can stream maximum of 9000 shares for a API key.
The ltp is 91.5. And your trigger price is 91.5. Your trigger price should be lower than ltp(91.5). That's what was happening with you yesterday too,your trigger price is the ltp itself. Maybe you should check your code.
You can read these articles:
https://kite.trade/forum/discussion/3490/query-on-avfailability-of-historical-minute-candle-data-and-corporate-actions
https://kite.trade/docs/connect/v3/historical/
You can use this list to know the stocks which are allowed under mis or co.
https://docs.google.com/spreadsheets/d/1ZTyh6GiHTwA1d-ApYdn5iCmRiBLZoAtwigS7VyLUk_Y/htmlview#
@rogerrajeev32 No,you have to place entry order and gtt separately. You can write code to check if your entry order has been completed and then place a gtt. In api(even in kite web and app,you can't set target and stoploss as percentage if you plac…
And while searching for the answer to your question,i found a issue too. In the historical data doc's example, the curl shows that the data was requested from=2015-12-28+09:30:00&to=2016-01-01+10:30:00 and the data was requested at 2016-01-01+13…
@gururammohan The correct trading symbol is NIFTY21D1617400CE. Read here:
https://kite.trade/forum/discussion/5574/change-in-format-of-weekly-options-instruments#latest
The charts are formed by the ticks received by zerodha. But it's possible that trades can happen out of the range of ticks received by zerodha. So,the price actually went to 410.7 and even higher than that as can be seen that your order actually tri…
These are post market trades.
https://support.zerodha.com/category/trading-and-markets/trading-faqs/market-sessions/articles/what-are-pre-market-and-post-market-sessions-and-orders
You will have to loop in the list of orders to cancel or modify all open orders at once. Bulk cancellation or modification single API is not available.
Look at the time of your orders. The sell order was placed at 33:13, before the buy order was completed at 33:32. That's why it gave margin not sufficient error. If you are placing limit orders,then you have to modify your code to check if the order…
@ronstrader the first order is sl. This gtt is for selling. Means after you buy it,to squareoff. So ,the first order is sl. And second one is target. When one of the two is triggered,the other one is cancelled.
The feature you want is not in the api for now. You have to buy the option and then place a sell order. Or you can just automate it to place a sell order with your required target as soon as your buy order is completed. And the squareoff,trailing st…
@rogerrajeev32 And here is the trick. If your order fails in api,try it manually . Most of the times,you will find that there is something wrong at your end. I also did the same for your order to find the reason.
@rogerrajeev32 Just stay here on the forum.Read all the faqs. Atleast once a day,come and read all the new discussions,even if they are not of your concern. Knowledge never goes waste. I do the same. Especially,read all the comments of Rakesh Sir a…
There is no weekly expiry if its the last Thursday of the month. You must be looking for the instrument token of 'BANKNIFTY21N2538000PE'. Instead,search for 'BANKNIFTY21NOV38000PE'.
This is the instrument token-13814530.
You can read this to kn…
@trk0653 in ohlc. the open and close do not change. Because open is fixed in pre-market,and the close value in ohlc is actually the closing value of the previous day. The high and low may change or may not change according to the market conditions,…
@skeesara Just get the request token once every day,get the access token and use kite.set_access_token. Then you don't need to get request token to run your app for that day. And do you mean redirect url by 'request url'??
Yes you can use https://…
There is no such api as tick.getOI(). To get oi,either use quote api and extract oi from it. Or,you can use websocket, subscribe to your desired instrument(s) and extract oi from the incoming ticks. Example:-
def on_ticks(ws.ticks):
for tic…
Oh,my bad. Thanks for correcting. Actually,i was also thinking that quote ohlc gives true data during market hours too,it can't be from bhavcopy, beacuse bhavcopy comes at EOD. But i couldn't find any answer,so i gave him this article. . I had a s…
@Anbalagan use 'if' condition to set your target condition. like
if "your target condition":
kite.place_order(params)
Or if your target is fixed , place limit order for target as soon as your trade is executed.
Today's Historical data is formed by the ticks received by zerodha. quote api is giving the ohlc from bhavcopy. The quote api value is correct.
Read this, https://tradingqna.com/t/why-are-the-ohlc-values-on-daily-and-hourly-charts-different/17495/2
Look,i dont know what trade tron is. Its simple,for each app you create on kite developer account,its 2000 rupees. From what i can understand is ,yes,you can use the same api keys. tag sujith sir or rakesh sir if you want more info.
Yes,for each app you create in developer , its 2000 rupees. But if you have to just test strategies,why don't use the api you already have. No need to create multiple apps.
You can only put one square off order (either sl or target). If you want to place both,you should have enough margins to place another sell order (in lakhs). There is no way now. Damn stupid sebi. The good old days.
Get some knowledge about charts before using api. Volume bars or anything in the market won't tell you if buying or selling happened. Beacuse they happen together, that's what's called a trade. for every buy, there is a sell and vice versa. About th…
But you can just use the order_margins. Just pass in a list of orders. Basket orders api is for enjoying margin benefit and it will give bunch of useless information if you want to trade in different stocks or derivatives. And it seems you want mar…
@abhijit Just use the latest order id to exit because that will be the position which has not been closed. Means fetch all orders for sbi and put [-1] .
It's a problem going on from the past few months for some people. I have mentioned you in a post about this problem. You can read more about this issue there,but for now, there is no solution,as the exact cause is not known.