Selling from Holdings when I have not sold it from API

naveen278
I agree it should give orders with the right API and we sell orders when in profit, but I am seeing an issue you can correct if my understanding is wrong. I have BSOFT in my holdings and orders. Below is my point:-
a) I bought BSOFT in the morning and I sold for example BSOFT today in profit of Rs.4, the same orders I bought in the morning
b) but Positions tab in the APP shows "Sold HOLDING" of BSOFT
c) Next day when I check my profit it shows BSOFT is loss since you sold BSOFT from your holdings (not your orders). I am seeing this issue second time.
d) My sale of holdings I have put on hold (via API), hence this never gets executed.

How do I resolve this., I see it is an API issue.

Also if for that Order ID I have sold it should get rejected by the exchange. Rather it is selling from Holding which is not correct.
Keep me posted.

TEAM PLEASE NOTE I HAVE NOT DONE ANY SHORT SELLING OR NEITHER I HAVE SOLD ANY STOCKS FROM MY HOLDINGS (EITHER MANUALLY OR VIA API). PLEASE DONT CLOSE THIS TICKET IN A HURRY.
  • SRIJAN
    SRIJAN edited August 2022
    This forum is purely dedicated to technical queries related to KiteConnect APIs.

    KiteConnect just displays the data on Kite.

    Rakesh Sir has already responded to your query.

    https://kite.trade/forum/discussion/comment/40198/#Comment_40198

    If you want more clarification regarding this query or other non-technical queries, contact support team as told by Rakesh Sir.
  • naveen278
    I saw that answer it does not answer my point, it is talking about selling from Holdings and buying it back,etc. The point I am making here is that I have not sold anything from holdings via API, but only via Orders (which I executed via API for buy and sell ). Then how is holdings getting sold.
  • naveen278
    Then how is holdings getting sold? When manually and via API I have not executed any holdings sale.
  • SRIJAN
    Do you understand anything at once??

    This is not the forum for non-technical queries.
    You have to contact Zerodha support team for these queries:
    https://support.zerodha.com/


    Now, don't create duplicate threads multiple times.
  • naveen278
    It is very much a technical query, when I have bought 3 BSOFT VIA API at 336 and Later sold at 339 the 3 orders for that Order ID via API again, then later when I sold again VIA API the order (not holdings) EXCHANGE Should Reject it , rather it sold from holdings.
  • naveen278
    The BSOFT at holdings is a loss and I am not clear why the BSOFT is being sold from holdings via API for that ORDER id.
  • naveen278
    Also I am seeing this problem only for BSOFT it happened few days earlier also. I dont see this problem with my other several stocks in my porfolio.
  • naveen278
    Below is the code it is clearly orders I am selling along with orderID and Tag

    OrderParams orderParams = new OrderParams();
    //orderParams.or
    orderParams.parentOrderId=orderID;
    //orderParams.parentOrderId
    orderParams.quantity = iquanity;
    orderParams.orderType = Constants.ORDER_TYPE_LIMIT;
    orderParams.tradingsymbol = strRemoveExchangeInfo;
    orderParams.product = Constants.PRODUCT_CNC;

    orderParams.exchange = Constants.EXCHANGE_NSE;
    orderParams.transactionType = Constants.TRANSACTION_TYPE_SELL;
    orderParams.validity = Constants.VALIDITY_DAY;
    orderParams.price = d_price;
    orderParams.triggerPrice = 0.0;
    orderParams.tag = strtag; //tag is optional and it cannot be more than 8 characters and only alphanumeric is allowed
    System.out.println("The placeSellOrders Step 2 " );
    Order order=null;




    try
    {
    order = kiteSdk.placeOrder(orderParams, Constants.VARIETY_REGULAR);
    //logger.writeToRandomFile("placeSellOrders method place orders done");

    }
  • naveen278
    This is turning out to be serious today again I sold from orders but I see 39 BSOFT shares were sold from holdings, I did not use holdings API, this is serious, I am not clear how to solve this now.
  • naveen278
    This is turning out to be serious today again I sold from orders but I see 39 BSOFT shares were sold from holdings, I did not use holdings API, this is serious, I am not clear how to solve this now. I did not sell even a single share from my holdings API or manually but 39 BSOFT shares were sold from Holdings. I sold only via Orders api to get the orders and sell the orders which I bought via CNC.
  • sujith
    If you do a sell CNC then your holdings will be debited. That is how it is intended to work. You will have to do Sell MIS, if you don't intend to sell holdings.
  • naveen278
    You mean even if I sell from orders API and get orders and use the same order ID of Orders API but holdings will be sold, My Understanding Orders API will give only day orders and once you sell with the orders ID provided by Orders API it will sell only that days orders and will not sell your holding stocks.
  • naveen278
    You mean even if I sell from after retrieving from API (get orders) and use the same order ID provided by Orders API but holdings will be sold? My Understanding Orders API will give only day orders and once you sell with the orders ID provided by Orders API it will sell only that days orders and will not sell your holding stocks. Also for holdings there is a separate API getHoldings. I am not using that.
  • naveen278
    You mean even if I sell from after retrieving from API (get orders) and use the same order ID provided by Orders API but holdings will be sold? My Understanding Orders API will give only day orders and once you sell with the orders ID provided by Orders API it will sell only that days orders and will not sell your holding stocks. Also for holdings there is a separate API getHoldings. I am not using that. I dont think what you said is right, since in the APP when I sell from orders section beyond its limit it rejects and does not sell from holdings.
  • SRIJAN
    SRIJAN edited August 2022
    Did you ever read the documentation?

    Holdings API is not used for selling the shares.
    Holdings API is just to view the holdings.

    And what do you mean by using the order_id when selling??
    You don't give any order_id in the place order request.

    You really need to get a understanding of how these things work.


    If you want to do intraday trading in stocks,you have to use MIS product_type.

    Using CNC to sell will debit the shares from your holdings as Sujith Sir told above.

    The same was mentioned in the support article I provided you in your previous thread regarding this same query :

    https://kite.trade/forum/discussion/comment/40199/#Comment_40199

    Try to sell a stock which you don't have in your demat as CNC and read the error message,and you will understand.

    Still,if you can't understand ,refer the support team.
    The API just places orders like you do on Kite web/app.
    If the API is not working or other technical issues with KiteConnect APIs, write on this forum.
    For queries not related to KiteConnect APIs,you have to write to Zerodha support.

    Even after telling multiple times,you keep spamming the same thing again and again.

    Also, there is a option of editing your comments. Use that. Don't post the same comment multiple times by just adding one extra line in the comment.

    This is really confusing.
  • naveen278
    You respond very quickly with ought understanding the context, it is not happening for many other stocks only for BSOFT.

    a) You can very much sell shares in the APP which you bought in the morning, open the positions tab in the app and sell for the day from that tab (not holdings tab the CNC orders) , even if it is not an MIS order. So why are you saying it cannot be done? Please check the APP again even if not MIS orders.

    b) I can get all orders which I got for that day and use that Order ID in place orders as below
    Then what is this below in PlaceOrders :-
    orderParams.parentOrderId=orderID;
    orderParams.tag = strtag;
    I am passing order ID which I got from getOrders to the placeorders as above also Tag passed. Also passing same Strtag got form orders to placeorders.

    c)
  • naveen278
    Please dont keep closing cases just because your convinced. I have to be convinced. The idea of getOrders to get Orders for that day to act upon.
  • SRIJAN
    SRIJAN edited August 2022
    a. Yes,you can sell but you shouldn't use CNC.
    You should use MIS,which literally means Margin Intraday Squareoff.
    This product has been made for intraday trading.

    If you use CNC,you will get a 'HOLDING'tag in the position,which is happening with you,and is mentioned in the support article provided to you previously.

    Same here:
    https://support.zerodha.com/category/trading-and-markets/margin-leverage-and-product-and-order-types/articles/what-does-cnc-mis-and-nrml-mean

    So,I think that's where the problem is.


    b. Please read the documentation properly:

    Parent order id is used only for multi legged orders,i.e Cover Orders.

    https://kite.trade/docs/connect/v3/orders/#response-attributes

    Tags are just to filter orders. The tag you send with an order cannot be linked to any other order.

    https://kite.trade/docs/connect/v3/orders/#tagging-orders

    This is why it's confirmed beforehand by the Zerodha KiteConnect Team ,that the user has understood the documentation properly before using the KiteConnect APIs.

    https://developers.kite.trade/signup

    c. The orderbook API is just used to view the orders placed on that trading day.
    The attributes of one order do not have any link to attributes of another order unless they are multi-legged like CO.

    This forum is not for queries non-related to KiteConnect APIs.
    Even if there is an issue, it's certainly not an issue of the place order API.

    If you're not convinced,why are you so hesitant of talking to the support team??
    They would solve your query very easily.

    Please, don't increase the length of this thread unnecessarily.
Sign In or Register to comment.