17071 : The order could have resulted in self trade

anudeepsharma
Order that throws following error in kite.zerodha.com and shows Cancelled
"17071 : The order could have resulted in self trade"

getOrderHistory api for that order does not return "CANCELLED" instead it sends order is OPEN.
  • anudeepsharma
    check order id 200929201046568 ...it does not say it was cancelled but console says so... how to catch it?

    200929201046568 PUT ORDER REQ RECEIVED
    200929201046568 VALIDATION PENDING
    200929201046568 OPEN PENDING
    200929201046568 OPEN
  • sujith
    Maybe you pulled data before it the order history got updated.
    Here you go, you can refer to a similar order.

  • zw0330
    NSE in 2015 introduced this mechanism to prevent self-trade for a client who has multiple orders open for a certain scrip which are likely to match with each other.

    If an active order (orders that come in to match the existing orders) is likely to match with a passive order (Orders lying unmatched in the system) in the same order book belonging to the same client, either the active or passive order resulting in self- trade will be canceled by the exchange.

    This essentially means if there is a scenario where one of your order is in the best bid/offer and you place an order in the same scrip and this order is about to match your own earlier passive order, then this new order will be cancelled by the exchange.

    This is applicable for all Day and IOC order types; limit, market, stop loss, stop loss-market.
Sign In or Register to comment.