please provide the way to resolve this issue
You can fetch full instrument list to get list of trading allowed contracts.
And please confirm if this issue is from kiteconnect or not.
As, said above it's not an issue but works on the strike framewo…
"Exception while downloading OC for NIFTY 'NIFTY22SEP14200CE'"
This is the wrong symbol. You can fetch all trading stikes/instruments from the full instrument list.
will it be possible to add freeze_limits column in instruments-token-file.
Yes, it will be available in the new instrument list. We will announce here once live.
For the time being, as the freeze limit doesn't change often you can fetch from the nse…
Could you please confirm if you checked both tick time & system time?
Yes, i use py logging facilities along with system time. The logging structure is :
logging.basicConfig(level=logging.INFO, filename={file_name},
format='%(asctime)s - %(mes…
is it okay to use the "last_price" that we get from kite.positions() to calculate PnL ?
The last price field in positions APIs is not updated in real-time, as it's designed to prioritize quantity and acquired average price fields. So, if you are loo…
what happens to the websocket connection when the token expires due to the change of date?
You can use subscribe method to subscribe to the new list of tokens.
Yes, your order: 220921000043206, was placed at market 09:15:02 and got completed at 09:15:05. You can expect few ms delays sharp at market open. This article explains more.
How do I close and restart the websocket as and when required by the logic that I am writing?
You can't. You will have to spun-up the whole process again to initiate a websocket connection if it's forced closed/stopped from your end.
I tried reproducing this today, subscribed to 1000 contracts including BANKNIFTY SEP FUT(9604098), and logged FULL mode tick(that has timestamp) for the same, until 15:30, I was not able to see any difference.
twisted.internet.error.ReactorNotRestartable
This error is thrown by the Twisted when you are trying to re-run a reactor that was stopped. You can not use the same process to re-run the reactor, once it's stopped by the reactor.stop() event. This sa…
failed (403 - Forbidden))
This error can only come if you are using an wrong access_token in WebSocket initialization. You need to re-check, if you are sending it as a proper string, without padding any extra string/spaces.
Below are the segments available in instrument list:
{'NSE', 'BCD-OPT', 'NFO-OPT', 'MCX-OPT', 'BSE', 'CDS-FUT',
'INDICES', 'NFO-FUT', 'BCD-FUT', 'CDS-OPT', 'BCD', 'MCX-FUT'}
Web server is returning an unknown error Error code 520
Are you getting this exception continuously? How many symbols you are requesting for LTP fetch?
I'm logging ticker data since the last hour for 13297410(BANKNIFTY2291541800CE) , but still can't see the difference in last_price field of kite websocket vs kiteconnect ticker. Can you paste tick logs with timestamps for the same instrument 1329741…
The message state that the required margin was 197583. You can refer order window to get the updated required margin. This article explains more about the difference/updated margin.
Any API to get the stocks which your trading is blocked by NSE for Shorting or ShortSelling so we wont trade in those stocks,?
No, there is no API for this. BE-category stocks are not allowed in MIS.
so you mean to say that no exception will be generated
An exception log will be generated, but the connection will not be closed.
I should let the auto-reconnect feature take care of the situation?
Yes. A good practice here is to not stop/close the …
It should come fine if using the correct instrument token. Is on_error method throwing any error?
Sample response for Nifty 50:
[{'tradable': False, 'mode': 'quote', 'instrument_token': 256265, 'last_price': 17842.05,
'ohlc': {'high': 17925.95, 'l…
Running kite ticker, when http connection is lost, I get a log error message:
where shall I put try-catch to catch the error 1006 as mentioned above?
You don't need to handle this here, as ticker auto reconnects by default. Just make sure not to hav…
orderParams.exchange = Constants.EXCHANGE_NSE;
Make sure, you use correct exchange NFO for BANKNIFTY22SEP39400PE. You can fetch all contract details from the instrument list.
I don't know what went wrong . Monday and Tuesday it did not work but it worked well today without any issue.
Maybe you can re-check the error message logging setup.
Is there any issue with BSE data?
No, it's not an issue. As said above handling should solve all random timeouts, You need to handle this exception and retry to fetch for the same period with adding some delay.
I also want to track the stocks which …
Are you trying to fetch this older data for the BSE contract?
You need to handle this exception and retry to fetch for the same period with adding some delay.
When should I have the API fetch in the morning to make sure I have the latest possible data
The instrument list is updated around 8 AM every trading day. It's recommended to fetch post that.
How I can generate the access token?
The whole login flow is explained in detail in the documentation.
Could you please help me in generating the access Token?
Please send me your email.
We don't assist in providing coding support. You have to take …
So I'm fetching - NIFTY22NOVFUT Data which Instrument_toekn is - 13669122, this symbol data I'm not getting through Kite. historical.
I just checked historical data for same instrument token: 13669122, it's coming fine. Maybe you to re-check on cor…
peer did not finish the opening handshake in time
This usually happens when ws takes longer to complete a handshake i.e WebSocket handshake timeout field, majorly due to heavy load. You need to inspect the callback ticker instance here.
You can call stop method to stop websocket connection, as per your requirement outside of on_close as well. close event is called when websocket closes due to any reason, if on_close method callback is assigned.
In the meantime, there can be many use cases that can use the postback url.
We will check on this.
For now, we will request you to use WebSocket order update, it's quite straightforward to use.
I just used the same set of order params as yours and it's working fine. To me, it seems like an import or block error of the publisher js file in your browser. Can you inspect the same by using chrome's debug console?
While doing a live test of the codes
Are you trying to run a multi-threaded ticker setup? Can you explain more on your set-up?
If yes, you need to enable threaded instance using threaded=True in the ticker callback.
kite.add({
.....
tag: 37682,
});
You need to pass the tag field as a string. You can update that and retry. Apart from this, I don't see any issue in your order param. You need to recheck if you are passing correct values for all variables assigned …
You can follow this thread to know the latest developments on the SEBI's consultation paper on the algo trading. For more details, you write to the compliance team at kiteconnect(at)zerodha.com.
But when i pull list of pending orders using kite.orders() during market hours, the variety change is not being reflected
The variety field can't be modified once the user places the order. So, variety remains the same in the order book through. But…
how do I handle conflicting exits on the same instrument
Maybe you can add a pre-condition for inspecting present open orders, position, etc as per your requirement.
possible to Place new buy Order directly as GTT order as first buy (kiteconnect.place_gtt) ?
Yes, you can place a GTT order. Based on triggers, these are placed as a normal order.
kiteconnect.exceptions.InputException: Invalid order params.
'trading…
How do I exit the program gracefully after market hours?
Go through this thread.
What happens to the WebSocket callbacks post-market hours?
It remains active until disconnected from the user end.
Next day when I check my profit it shows BSOFT is loss since you sold BSOFT from your holdings (not your orders)
This might happen because of BSOFT being Trade to Trade stock. For T2T stock, the buy average will be the latest buy price. This articl…
Still,I can't understand one thing, @rakeshr Sir,
why is the code for InputException 500 in the php client?
Thanks for highlighting this. I will review and update the same.
@Guhan
AttributeError: 'NoneType' object has no attribute 'sendMessage' "
The subscribe method uses 'ws' object which is the current initialized websocket object.
Correct. As, you can refer to here, subscribe/un-subscribe method uses websocket obje…
TokenException: Token is invalid or has expired
You need to recheck if you are passing the correct request token string. Recheck on reading values from the file part, if any extra values like `\n`, etc, get added while reading.
Total no of data should be 45000 based on the pattern, data is being received
What pattern? As explained before by @sujith in this thread, ticker follow no fixed timestamp pattern. Tick is generated only if a trade/market depth change happens. And i…