if I pass continuous=1 and use the instrument token, will it fetch minute level data expired contracts
No, only day-period data is available in the continuous. Go through the documentation here.
def on_connect(self, ws, response):
log.info('on_connect')
# this is a list of 2930 tokens, please check the attached file
# for code with all tokens
self.all_tokens = []
ws.subscribe(self.all_tokens)
ws.set_mode(ws.MODE_FULL, self.all_tokens)
By d…
I have been tagging every order I place since last few months. When I checked PnL for each tag, I see that the calculations are very wrong.
Do you mean adding a tag while placing an order? Those tags won't be reflected in the console. Console tag is…
The issue should be caused because of your local network connection or firewall settings. You can change the network and inspect it.
You can handle connection errors as below:
try:
.....
except ConectionResetError:
# Re-try, etc
getQuote for BankNifty is giving all the values correctly except Buy and Sell Volume
Didn't get you? Quote APIs show the exact quantity pending as buy or sell orders at the exchange.
Can you paste here the response, along with a comparison source?
a. The above Place GTT OCO order alone will fulfill (sufficient in placing ) my requirement (bracket order)?
No, you need to place two orders as per your use case, an entry order(Buy/Sell) separately and then use two-leg GTT for stop-loss or target …
What is the alternative solution for this ?
This API returns the LTPs of up to 1000 instruments in one go.
Yes, you can pass the list of instruments. Go through the documentation here.
Can't I get options LTP's in angular application using kiteconnect
No, basically you can't make requests from any of the front-end apps. You can use the Nodejs client elsewise.
I can see no functionality over there to cancel the gtt orders which are not executed.
Triggered GTT will be available in the orderbook. You can fetch those and cancel them.
No, GTT is meant for placing two-legs i.e stop-loss and target orders for the parent order. You can use CO orders(only intraday) as per your requirement.
so, i think there may be some issue with the new version which is not compatible with the old code.
No, I have placed a couple of 100s of orders using the latest pykiteconnect version v4.2.0 and all went fine. Can you DM me a detailed log for such t…
Is this what you call Polling? that, I am doing repetitive API calls to verify data.
Yes, it's not recommended. Historical APIs FAQs explain more about this.
After requesting the data again and again, I observed that options candle data changes.
Are you polling this in the live market?
Can you paste the complete candle data with the requested timestamp? We will debug this.
There is a single data source …
Is it possible to get Nifty 50 intraday options data(for weekly expiry) from historical API
Yes, you can get intraday historical data for the active options contract. Go through the documentation here.
PS: Historical data won't be available for the …
1.ZINCFEB23FUT 2.ALUMINIUMFEB23FUT 3.LEADFEB23FUT 4.COPPERFEB23FUT
You are using wrong trading symbol. Year YY should be before month name, eg: ZINC23FEBFUT, ALUMINIUM23FEBFUT, etc.
You can fetch trading symbol from the instruments list.
HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
This is not related to kite connect lib(here pykiteconnect), but your underlying network. As, @sujith mentioned above you can handle time-out with order book insp…
.... Try placing LIMIT or SL order
As the error message states, MARKET order for those contracts is not allowed, you need to place LIMIT or SL. This article explains more.
TypeError: deprecated() got an unexpected keyword argument 'name'
Looks like some kind of local conflict for pyOpenSSL or cryptography. You can try the commands mentioned here.
how is the margin required calculated ?
It's calculated in real-time, considering your open positions and open orders.
https://kite.trade/forum/discussion/comment/26960/#Comment_26960
It's a complex calculation. You can keep using order margin APIs.…
"POST /session/token HTTP/1.1" 200 None
It's authenticated successfully, you can see HTTP status 200.
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "
Also, this is not an error but a debug log, as you have stated above mentioned log under …
Can you give the complete request param for the order_margins call?
Also, you seem to be sending the wrong value for transaction_type, it should be Uppercase SELL. Go through the input params details.
I just checked py kiteconnect GitHub workflow for py v3.11 locally, it's working fine.
Will add py 3.11 in the python client GitHub workflow in the next update.
While opening the Python Kite Connecct website its thrown an error like "Can't reach this page"
Opening fine for me. Can you check again and re-post if the issue persists?
this data is getting loaded on loading a chart.
You have to apply these studies before on the kite web chart to get it in tabular form. And these studies/indicators can have multiple input variable fields, which can't be possible in the raw OHLCVOI …
(SSL error: sslv3 alert bad record mac (in )) - 655 of ticker.py
Looks like your other thread created is closing the main connection in multi-threading. Maybe you can check at line no:655 of your file(ticker.py) and inspect further.
chrome executor to automate my trade
This against the terms of use. You are using selenium to automate the flow. You need to buy an API subscription to use kiteconnect APIs.
sing the python kite library's kite.ltp() function every second.
Quote API is not meant for continuous polling. You should use websocket streaming as per your use case.
if order placement time is 10:00 AM
Is this your local system time? Can you check if it's synced properly to IST.
You can go through orderbook response documentation, to know about order_timestamp and exchange_timestamp.
Are you pooling historical data APIs for real time candles? It's not recommended, this thread explains it in detail.
Both Kite web charts and APIs use the same data source. So, there can't be a difference. Maybe you can query now for yesterday's dat…
gives me data from 9:15 to 3:25 for 5 minutes and 9:15 to 3:15 for 15 minutes
Yes, the candle shows the data once the market starts for the respective exchange.
To include pre and post-market data, you can use WebSocket streaming and form candle at…
Now to add tradetron , you are asking more credits .
Tradeon is not our official client. You need to contact them. For kiteconnect APIs, you need to pay Rs2000 per month, go through FAQs to know more.
But when it is lower, it times out sporadically, not specific to any trade symbol.
This may happen in rare instances for a few very illiquid BSE contracts, as explained here.
I just checked on my end, and it's working fine with the same latency as before. Maybe you can inspect the local network of your setup.
Also, is this specific to historical APIs? Or latency has increased in other API calls as well.
We have recently upgraded the kiteconect package 4.1.0
You are on the older version, v4.1.0 went live on May 2022. The latest version is v4.2.0. Go through the readme to know the older breaking changes, same was notified/announced on the forum 9 mo…
Yes, for day candle interval time will come as 00:00:00+05:30 for hours and minutes stamp. Complete date field will be eg:2022-11-22 00:00:00+05:30
For minute candle intervals, you will get values for hours and minutes. eg:2022-11-22 09:15:00+05:30
Could you please mention how these above messages would look like in case of partially executed order.
As, I explained above you need to check for quantity fields, unfilled_quantity, filled_quantity and quantity.
It would come with status of "status": "TRIGGER PENDING" and filled_quantity lesser than quantity. Something like:
{
"order_id": "your order ID",
"parent_order_id": null,
"variety": "regular",
"exchange": "NSE",
"tradingsymbol": …
is it guaranteed that all order-updates will be passes through web socket ( in on_order_update ) given i dont block web socket on my end
Go through websocket FAQs here.
is it safe to use for it as trigger for placing close order for the position( ne…
trigger_id = kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO,
tradingsymbol='NIFTY20OCTFUT',
You are using an expired tradingsymbol in the condition parameter. Go through the python gtt example here.
Is it that candles can ONLY be retrieved by GetHistoricalData method (which is part of historic api and paid)
Yes, go through the documentation here.
the current price is only retrieved in the form of ticker and not the candle
Yes, websocket streami…
API and WebSocket re-auth happens every day around 07:30 AM. So, you need to use fresh access token, every day. This is as per exchange regulation. This thread explains more.
Is there a way to get the margin required for a future or option lot independent of the current position/ orderbook?
Yes, you can use basket margin API with consider_positions query param as False.
Can I use it this way to loop through implementing same strategy across all the accounts.
Yes, you can. Just make sure you are not exceeding individual rate limits for each API key/app.
No response from server with error code: ENOTFOUND
Are you not able to make any kiteconnect API calls?
If yes, then it looks like your firewall issue. You can also try out a couple of solutions mentioned here.
Will the order status be OPEN or will it be CANCELLED?
It will be open. And once the price comes between the trigger and the price range, it gets executed. This article explains more.
Retrying connection. Retry attempt count: 1. Next retry in around: 3 seconds
This is because of disconnection at a network level. Make sure, there is no firewall restrictions and connecting through a stable network.
{'status': 'error', 'message': 'invalid json', 'data': {}, 'error_type': 'InputException'}
Looks like you are directly making an HTTP Post call with the above payload. If yes, make sure you are sending header Content-Type as application/json. Go thr…
ws.send({"a": "subscribe", "v":[738561]})
Looks like you are using some websocket client. You might not be parsing binary packets correctly. Go through any of our official client libs to understand the tick binary packet parsing structure.
If a user has logged out of any third party platform then it's against the user's privacy policy to share data with a third-party platform. The only workaround, I see is maybe you need to inform your clients to place orders on your platform for orde…
@ sujith yes but nothing understand.
You need to recheck that you are sending the correct credentials of the API key, Secret Key, and correct extracted request token.
Unless any of these tokens are wrong, the login flow should be fine.