Thanks for the answers @sujith . Messaged you the user ID. Will process orders accordingly, but I would expect zerodha not to return any order ID when the basic margin requirement is not met.
Is there a page where the detailed description of what data is available and what is not, is given? If yes, pls share the link. If not, pls create one. Thanks.
These are NSE CM symbols. For example, there are 1070 CM symbols currently active and downloading each one for 2022-01-01 to 2022-01-31 has resulted in 7 failures, but all 7 succeeded when called again.
Getting Data for CSBBANK, 3831297, 2022-01-01…
@sujith The order JSON is parsed into a db query as the first step. The fields are expected to be as given in the API documentation. Checking each field for validity is expensive and slows down the system. Pls use your internal testbed for private b…
Hi Sujith,
Does this API return the margins for all symbols in one go? Calling it for each symbol will be unwieldly.
We usually call the margins endpoint just before market starts & use it for the day across all users.
Pls advise.
Regards,
Ra…
Hi Sujith,
The first endpoint is
https://api.kite.trade/instruments?api_key=
The second endpoint is
https://api.kite.trade/margins/equity
Thanks for looking into it.
Regards,
Ramakrishnan S
quantindia.in
We are using the websocket streaming method and get about 2-3 responses per second for 300+ symbols. But each response may have only a subset of symbols, anywhere between 20 to 300. This has been running for couple of years now.
Regards,
Ramakrish…
The OI values have started changing from 09:53:05 at our end.
From one of the algo logs,
At 09:53:00,
INFO : DATA: NIFTY21MAY14500CE START PRICE/OI 416.85/1385775, CURRENT 436.8/1385775, PRICE DIFF 4.79% OI DIFF 0%
INFO : DATA: NIFTY21MAY14500PE S…
Thanks @rakeshr The error rate is like 206 errors in 8090993 records, captured over 20 days across 146 currency symbols. So you need to check across all currency option symbols over a few days.
Here is one log file that shows the full details of th…
Hi,
Did a deep-dive into this. There were 206 data tick errors in currency data for Feb20 (from 01Feb to 20Feb). On further analysis, looks like the data gets shifted by one or more places in the data array, thereby messing up the values. Issue is s…
Hi @rakeshr Same code has been running for months now. Data streaming started working after 09:05:00. You may want to check things at your end. Thanks.
@rakeshr Thanks for looking into this. Instant response is crucial for options trading. A 3-second delay in retrieving the trades may result in increased slippages down the line in the algo.
Max no. of trades are less than 200 in our case. Appreci…
@sujith Strange. We are simply transferring it into the database directly from JSON (i.e. field names are matched 1-1). Not possible for any field mismatch to happen.
Anyway, now we are checking for NRML for variety for NRML orders. Hope it stays t…
@sujith In the order details from https://api.kite.trade/orders . Example below.
+-------+---------------+--------------------+--------------------+----------+-------------------+---------------------+-----------------+------------------+----------…
@rakeshr Thanks for the quick response. So it is available only in FULL mode. We are using QUOTE mode.
Is it possible to include OI in QUOTE mode? Problem with full mode is the max symbol count limit of 500. The weekly & monthly expiry symbol …
@sujith
If there are no trades, why is the tick being sent?
If there are no trades, why is 'close' 400.25?
Not only that, look this entry,
'last_price': 0.0, 'volume': 0, 'sell_quantity': 4875, 'last_quantity': 1000, 'change': -100, 'average_pr…
@sujith Ok, will update for this at our end. It would be great if you can keep the API documentation updated when such additions happen. That will save time & effort at developers' side. Thanks.
@sujith Thanks for the answer. It would be helpful if the API can return "target_price" along with trigger_price for parent orders. This will greatly simply processing at our end. Is this viable?
@sujith pls comment on getting the margins for option writing. Looks like this is a major missing piece. Calculating through Black Scholes method is not matching up.
Regards,
Ramakrishnan S
Neither the algos were changed recently. They've been running for months now without any code change. Perhaps this "exchange interoperability" has got something to do with it?
Thanks @sujith . I followed that thread to this - https://kite.trade/forum/discussion/2183/margin-calculation-for-bracket-and-cover-order?new=1
Hope the logic remains the same now as well.
Hi @sujith Today the MIS order for BANKNIFTY 27800 CE went through fine from kite web, but threw error with API for BO. The msg is the same - "MIS/BO/CO orders aren't allowed...".
Pls clarify.
That is called a "pipelined" 1-hour candle with a pipeline interval of 15min. I guess this should be doable in an excel. Alternatively, you can look at implementing it as a custom algo under quantindia.in .
@sauravkedia You can explore couple of things,
1) Run the login in the cloud server. If GUI is not allowed, you can use text-only browser in the terminal window and generate the access_code.
2) Make sure that your https SSL certificate is in good …
Hi @tonystark
We had to scramble our feet to avert login script failures, just in time.
It would be great if you can pre-announce such updates to the developer forum (say at least 1 week in advance) before deploying it. Appreciate your cooperation…
@Nikhil.A To give an example,
(1) User sends a buy BO for SYM trading at Rs.100, with SL -2, TP +2, (i.e. SL 98, TP 102)
(2) Zerodha sees that there are two offers with qty 7 and qty 1, at prices 101 and 102
(3) Zerodha completes the buy trade for b…
@sujith The parent order had sufficient difference. When the order was split up into 7 and 1 by zerodha, the same differences should've been maintained by your system, irrespective of volatility (because the difference is set after taking into acco…
@nikhilbansal
(1) Install Dataram RAMDisk software
(2) Create a RAM drive with (say) 1GB in T:\
(3) Create a .net C# app "stream.exe" which creates one file per tick, like "T:\tick_2018-10-10 13-12-44.data". If one tick is too fast, do it every 1…
@sujith all these orders were created by Zerodha. Only the parent order (qty 8) was sent by user through API. If the order legs are going to cause problems, why should zerodha put out those orders in the first place?
More importantly, what should b…
@nikhilbansal create a RAM drive. When a tick arrives, dump the contents into a file in this RAM drive. Have another script "consume.py" to reach this file, parse it, store it in mysql and delete the file. If required, you can have multiple "consume…
@sujith I was hoping that there is a simpler way to find out whether a BO has hit TP (or SL). Looks like there isn't. The method of processing all the legs of BOs to find the P/L is rather unwieldy, when the no. of symbols & trade frequency are …
@sujith yes it is a SL BO that got triggered when target was hit. My questions are,
1) Why is line [2] present? It is showing a BUY order as complete, which is not possible - the BO was a SELL order.
2) From this list of txns, how can I reliably ded…
Hi @rakeshr
No, not postback.
Here are example trades - https://quantindia.in/misc_afjhauweroiuafdlkjqew/trades_24Sep18.txt
You can see that there are several NULL values for parent_order_id column. This table stores whatever is returned by the …
Hi @connect_mohsinhanif couple of points that may help,
1) Create a RAM drive and put all the data files in it, if you keep accessing the data files for each run.
2) If your machine has multiple cores, make your script re-entrant and run multiple…
Hi @Imran I've seen this video, but there is no explanation for trigger_price and how it behaves when SL is also specified. Please provide this explanation.
@kris123 That circular is for NCDEX, not NSE or others. The circular says "The penalty structure will be applicable for only those members who have placed 10,000 orders or more in a day." and it also talks about a limit of 20 trades per second. As l…
@rakeshr Now it is throwing the error "16423 : Invalid Trigger price entered ". Both parameters squareoff and stoploss have been given, with order_type="SL". What is missing now? Should I set the trigger_price to + ?
@rakeshr Ok, lets say there was no trade in that minute. In your example, even though the volume is zero, the candle is present with same values for OHLC, right? The issue I am pointing out, is that the candle itself is missing. I was expecting the …
we are looking at the top 150 scripts in NSE (having the best Zerodha margins) . All of them have heavy volumes. I would expect a few hundred trades per minute. It is not possible that there is no trade for one whole minute for any of these symbols.
Well, "nifty 50" is an index. I would expect the value to change every second. Not receiving it every 10 seconds, looks like a real problem to be fixed. Pls see.
Supertrend strategies can be easily implemented in quantindia.in . You get full source code (Perl/Python). Your friends can also subscribe & auto-trade with your algo (you will have full visibility & control). If your strategy yields good ba…
I don't have the logs now. Most of the time it was "URL unreachable", but web sockets were running fine at the same time. Rarely it is "auth failure", but connects fine again when the script is re-started in couple of minutes.