Order placement

kivijoshi
Let's say that I bought 10 "INFY" shares using python client. My order was successfullyp placed and received the Order_ID in return.

Now I want to put this complete "order" in SELL position with particular target price. How can I do it? Can I use somehow the order_id to do the same? Some small example would be nice!
Thanks
  • sujith
    Hi @kivijoshi,
    You don't need order id for this.
    You can fetch positions and filter with scrip name and position type(MIS or CNC). You can check quantity and close position by placing the order with opposite transaction type and passing quantity same as current position quantity.
  • kivijoshi
    Thanks Sujith.

    How does system know that I am selling the previously bought script and not placing a new short position order?
  • sujith
    Hi @kivijoshi,
    All these things are handled at OMS level if you place an order for the same scrip with same product type and transaction type then new order quantity will be added to existing position.
    If you place an order for same scrip with different product type with same transaction type then a fresh position is created.

    I think you should place a couple of orders on Kite and check positions it will give you a clear idea.
  • kivijoshi
    Hi

    As suggested , today I bought few shares using CNC product type and "MKT" as order type. After few ours , I wanted to book profit. So I immediately put opposite side i.e "SELL" order again with "CNC" and "MKT". Strangely, I still see the open position on my "SELL" order. Why?
  • sujith
    @kivijoshi,
    Once you place counter order and square off position. The position will still be on the list but quantity will be 0.
    Basically, if you have a long position then it will show quantity as the positive value and if you have a short position then it will show the negative value.
    If a position is closed then quantity will be 0.

    Please place some orders on the kite.zerodha.com and check to visualize things otherwise it seems complicated.
  • kivijoshi
    So yesterday I bough 4 shares of MCX (with "MKT" and "CNC") and today I sold them (again with "MKT" and "CNC") . But in the Zerodha WEB , I still see the open position with quantity -4. So does it happen always that during counter order open position is showed till tomorrow?

    Product Instrument Qty. Avg. price LTP P&L Chg.
    CNC MCX -4 1218.85 1226 -28.6 0.005866185
  • sujith
    @kivijoshi,
    MCX doesn't have CNC, its product is NRML.
    Can you private message order id for both orders? We will check and get back to you.
  • kivijoshi
    I sent you the private message
Sign In or Register to comment.