logging.basicConfig(level=logging.DEBUG)
You will need to enable/set debug level logging as you are logging ticks here logging.debug("Ticks: {}".format(ticks)). You won't need to, if you direct print the ticks, print(ticks).
kite.set_access_token('m…
What are the use cases of on_message callback while using websocket?
You mean on_order_update?
It's for receiving order updates, the same as postback. For a multi-user public platform, postback is designed to be used and you can find more details o…
Clarify the difference between 'unfilled_quantity' and 'pending_quantity which we get on order update.
There is no difference, both represent the pending quantity. unfilled_quantity, is an legacy field, and will be removed in the next release.
Is there a time limit to retrieving orders and trades executed yesterday ?
Yes, you can fetch orderbook only for the current day, not for the historical orderbook.
If so, how does one get orders executed yesterday?
Currently, this is not available i…
how to fetch order id of the iceberg order instead of individual legs?
You need to check for order with variety:iceberg and quantity:total_quantity.
how to modify quantity in iceberg orders
You can modify iceberg quantity, only if the main leg is pe…
'RMS:Margin Exceeds,Required:2608519.58,
This is the margin requirement for fresh short SELL order of BANKNIFTY2350443400CE, so the possibility can be that a different product type, then the open position, so it was considered as a new order.
Is there a way to capture the trade taken in Kite Terminal using Web Socket?
Yes, you can use the order update callback. Go through the java client websocket usage example here.
To determine the number of legs for iceberg orders with a value between 2 and 10, you may use the rounded-off integer as 'iceberg_legs', and use quantity as total(here 2025), the last legs will be placed with the left-out quantity.
Are you still getting error evening after all request body as form-encoded (application/x-www-form-urlencoded)?
Can you DM your complete request structure?
can I connect a websocket only for receiving order updates, ie without subscribing with any instruments for receiving ticks?
Yeah, just have callbacks for order update.
we should use https://kite.trade/docs/connect/v3/margins/#basket-margins API to fetch brokerage charges.
Yes, you will need to use order margin API for this, as the charge is a nested element on the order margin API response, which requires one's o…
Can I call my Zerodha api from two machines , simultaneously ( within the API usage limits) ?
Yeah, yes you can. Just make sure, you are not exceeding the rate limits prescribed.
3) a combination of both.
This would be recommended depending on your use case. If you are looking for the status of Non-API orders placed as well. This thread explains all possible scenarios for order updates via WebSocket.
1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Go through the python websocket FAQs here.
so for long bank nifty option the transaction type will be "TRANSACTION_TYPE_BUY" and for stop loss order as per your answer it will be "TRANSACTION_TYPE_SELL"
Yes
Will order type be "ORDER_TYPE_LIMIT" or "ORDER_TYPE_SL"
SL order type, with trigger_…
ImportError: cannot import name 'DelayedCall' from 'twisted.internet.base'
Are you trying to restart the twisted instance, once it's stopped?
Can you paste here the complete error stack trace?
while fetching order details - couldnt get the order id
You need to handle this with retry. This thread explains more.
while fetching bank historical data - too many requests
Rate limits are defined here. Exceeding them throws this error. Maybe hand…
@KartikShah
I have deleted your above post because it contained API-related secret credentials. Avoid posting such information on a public forum, as it may compromise your account's security.
DEBUG:urllib3.connectionpool:
This is a debug log showin…
can it be found whether these options or what fraction of these options have been bought/sold by the traders/investors or market makers?
We do not receive this specific breakup of OI data from Exchange through streaming.
Along with the API key, they will need an access token, which requires your account credentials such as user ID, passwords, TOTP, etc., in order to have full access to your account. So, it is always advisable to exercise caution when sharing API key…
once the first leg (parent order) of an iceberg order is executed, its state is changed to COMPLETE, and immediately the second leg's order will placed into the market.
The second leg's orderId will be available in the orderbook only after the firs…
Zerodha streaming does not provide such "total" data.
Yes, there is no individual API for this.
This thread provides a solution for a similar scenario.
We flush all sessions, including APIs and Websockets, at around 07:30 AM every day. Users will need to establish a new WebSocket session if required fresh the next day. This process helps mitigate non-essential impacts.
Can a link be created to fetch it automatically?
No, you can only fetch live tick data or historical data not with an applied indicator. That, you need to build at your end.
Whenever the same API call is being sent in a loop this error is thrown .
504 Gateway Time-out
Are you making API calls exceeding the rate limits, in the loop? Add some seconds delay, for the next request in the loop.
message: 'The order quantity 1000 (40 lots) is higher than the maximum quantity of 900 (36 lots) allowed by the exchanges. Please reduce the order quantity or use iceberg orders.
quantity: 1000,
You need to place lesser than the freeze quantity, set…
orders = [...]
kite.place_gtt(...., orders=orders)
Orders should include tradingsymbol and exchange params as well. Go through the order list documentation and python oco gtt example.
GET /instruments/NFO HTTP/1.1
Whenever the same API call is being sent in a loop this error is thrown .
It's not recommended to download the instrument file for each request, but store it once at the start of the day locally and consume the same for…
Is it possible to fetch only those orders from API?
There is no individual API for this, but you need to fetch orderbook, kite.orders() and filter out those orders based on the status and order_type.
But I need 10-April every 5 or 10 or 15 min data, in that case, which subscription I should take, should I need to subscribe to historical data?
Yes, Historical candle APIs or you can use form candles at your end as well using the websocket streamin…
Since it is JUST VIEW mode I would like to leverage publisher API.
No, the Publisher JS plugin can't be used to make GET calls for account-related information. You can make only make a POST request (order placement here). Go through the documentatio…
Is there anyway I can find the tradingsymbol for expired options using instrument tokens?
No, currently we have made available only the current day trading instruments in the full instruments list. To get historical tokens, you will need to store/du…
kite.place_order(variety="REGULAR",...
You need to use small case letter for the variety field, here regular. Go through the order parameters documentation here.
Can you please add attribute freeze-limit in instrument token file itself.
Yes, it's added in the new instrument file and is under testing. Will be made available soon.
But the timed out screwed up a lot of trades for me today
Can you paste here detailed debug log along with the requested API end-point here? Are time-out specific only for an API call or for all kiteconnect API end-points?
But the issue is that it is giving me 'TokenError'
Are you getting InputException for the wrong instrument token or TokenException for an invalid api_key or access_token?
I can see the GUID value in order response
It is internally created by hashing multiple fields related to that kiteconnect app and order, including app_id, order timestamp, etc, to prevent order duplication at the same time, etc at the OMS.
Can the …
Didn't get you?
The full instrument list contains all details of trading contracts, including expiry, etc. You can fetch this and , filter the instruments, based on your requirement.
does zerodha make some changes in api configuration or api requests rate ? or something else changed without giving prior intimation.
No, there are no changes in the API rate limits. We always announce such major changes. Make sure, you have not spu…
We are looking for an API that can provide us with a list of eligible stocks for cover order
There is no API endpoint for this, but a workaround. This thread, explains more.
Was this a Zerodha-wide issue?
No, there was no such order delay on 28th March. We publically announce all platform-wise issues here.
Almost 4-5 mins delays for 15min timeframe
Was this specific only to that 15min timeframe? Can you give more detail…
only one leg is exited and other leg throws error .... Read timed out
Are both of these order post requests consecutively? Can you add some minor delay between them and check?
HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
Can you let us know, which specific API request is throwing this error? Is it happening for all the requests?