Exiting a trade

vijoeyz
vijoeyz edited May 2 in Python client
I open an intra-day position like this:

place_order(BUY, PRODUCT_MIS, TYPE_MARKET, VARIETY_CO, quantity, trigger_price)

Is it mandatory to close this position only by:

exit_position(VARIETY_CO, order_id) ?

or, can I close this position also like:

place_order(SELL, PRODUCT_MIS, TYPE_LIMIT, VARIETY_REGULAR, quantity, price)

What I am asking is that can I open position as VARIETY_CO, but exit the position as VARIETY_REGULAR? Will these be two separate orders?
  • sujith
    Closing an MIS involves only placing an order of opposite transaction type. But to close a cover order position, one has to modify the second leg order to market type. This is taken care of by the system by sending a cancel request with a variety co and sending parent order id in the params with the second leg order id.
    You can check out documentation here.
    pykiteconnect provides a wrapper to exit cover order position which requires the user to send order id and parent order id.
Sign In or Register to comment.