During the testing, I placed many IOC limit orders with prices very high above the CMP, but the orders, almost all of them, were executed like market orders. They just tag as IOC. I placed 100s of orders per minute and tested in a very high liquid instrument and a non-liquid instrument as well. Those orders are not strategy-based or time-based, as they were placed randomly from the system to know the behaviour. 99% of orders are executed regardless of price, as they are executed like a market order, which is not giving a guaranteed price. I have checked other platforms. Most of them were cancelled. They act as IOC.
Note: The price I put was not near the CMP; it was far away from the CMP to cancel the order deliberately. The client needs that exact price and quantity to match; if it is not available, then it should be cancelled immediately and removed from the order book.
I have not seen this kind of behaviour earlier; I did this same way many times, but the 99% order got cancelled regarding IOC logic.
Is Zerodha deliberately converting the IOC limit order to a market order? else Are there any internal issues with your system?
Can you fetch orderbook and the params for order type and price field? Usually the exchange matching engine tries to get you a best price, for buyers it will match with the lowest possible seller for order type LIMIT. Basically, you can't buy above last traded price. In order to buy above last traded price, you need to place stoploss buy order. It is vice versa for sell order.
Can you fetch orderbook and the params for order type and price field?
It was done a couple of days back, so I can't fetch the order book. I just tried it before on Kite Web with the exact same params as before.
Sujith, I don't put SL limit order above the LTP for buy, I am talking about simple limit IOC buy order
Usually the exchange matching engine tries to get you a best price,
Agreed, but how was it executed, both liquid and non-liquid instruments at far away buy prices?
As per the above snap, you can see that the buy price I put at 135.18 was trading near the 130 range. The IOC order will cancel immediately if the price is unmatched, so how did it get triggered?
This is in the nature of limit orders. The matching engine sees that you're offering to pay 135 rupees for a stock worth 130, which means you shouldn't mind the 5 rupee discount, so your order is filled at the best price available, which is better than your offer. If there wasn't a better price than your offer available, the order would get cancelled.
No problem. I think there is a misunderstanding of the semantics here. IOC is the order validity. The type is still limit. So while the order is valid for a very short amount of time, the nature of the order and the price parameters used to match it will still be based on its type. :-)
@Matti So, Does IOC have a higher priority? The exchange engine will try to match IOC order first before any other order? Are there any first considerations?
Nope. Priority is time-based. Order that hits the exchange orderbook first is validated first, if it can be filled, it is. If not, IOC gets cancelled and DAY gets entered into the depth and waits for fill.
Usually the exchange matching engine tries to get you a best price, for buyers it will match with the lowest possible seller for order type LIMIT. Basically, you can't buy above last traded price. In order to buy above last traded price, you need to place stoploss buy order. It is vice versa for sell order.
Sujith, I don't put SL limit order above the LTP for buy, I am talking about simple limit IOC buy order Agreed, but how was it executed, both liquid and non-liquid instruments at far away buy prices?
As per the above snap, you can see that the buy price I put at 135.18 was trading near the 130 range. The IOC order will cancel immediately if the price is unmatched, so how did it get triggered?
Can you check that?
So, Does IOC have a higher priority? The exchange engine will try to match IOC order first before any other order? Are there any first considerations?