Kindly refer the below mentioned steps to understand my question: 1. I have an existing holding for the trading symbol 'ALKEM' with average_price field value as 3412. 2. I sold entire quantity of this holding at '3344'. 3. Now holdings api is not returning ALKEM symbol. This is fine and expected behaviour 4. I bought ALKEM at price '3389' 5. Now holdings api is returning ALKEM symbol with average_price as 3412 where as I am expecting the average_price now to be 3389 Above orders are long term orders, and not intra day trading orders. If above question is nothing to do with the way API behaves, and something to do the way selling and buying on same day for long term orders, kindly forward me to the right forum. Thanks.
First of all,holdings api or any api doesn't provide any different data than kite web/app. The holdings api will return the same what you see in kite web/app holdings section.So,this question has nothing to do with api . You can search or write for other queries about zerodha on support: https://support.zerodha.com/
Or tradingqna: https://tradingqna.com/
If a user does sell and then buy on the same day then it is considered as intraday. Stock will not be moved from DEMAT and hence the buy average will be same.
https://support.zerodha.com/
Or tradingqna:
https://tradingqna.com/
For now,this post might be helpful:
https://support.zerodha.com/category/console/portfolio/holdings/articles/buy-average-holding-intraday
Please don't write about issues not related to KiteConnect APIs on this forum from next time.
You can know more here.