Order Types

What is Immediate or Cancel (IOC)?

Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy

DefinitionImmediate-or-cancel (IOC) is an order validity that fills whatever quantity it can the moment it reaches the exchange and cancels the rest at once. A buy of 500 shares at a ₹1,500 limit, with 350 offered at or below ₹1,500, fills 350 and cancels 150 (illustrative). IOC is one of the two standard validities on NSE, alongside DAY.
Formula
Filled = smaller of (Order quantity, Quantity available at or better than the limit); Cancelled = Order quantity − Filled
Example
Filled = smaller of (500, 200 + 150) = 350; Cancelled = 500 − 350 = 150. Average price = (200 × ₹1,499.50 + 150 × ₹1,500.00) ÷ 350 = ₹5,24,900 ÷ 350 = ₹1,499.71
Buy 500 shares · limit ₹1,500.00 · illustrative stockAsk priceQtyvs your limit₹1,500.50400above limit₹1,500.00150within limit₹1,499.50200within limityour limit ₹1,500.00AVAILABLE AT OR BELOW ₹1,500350 of 500 sharesDAY limit350 filled @ ₹1,499.71150 wait in the book at ₹1,500IOC350 filled @ ₹1,499.71150 cancelled at onceFOK0 filledAll 500 cancelled (only 350 available)Same book, three validities · before charges
Figure 1. Illustrative stock order book. You want to buy 500 shares with a limit of ₹1,500.00, but only 350 are offered at or below it (200 at ₹1,499.50 and 150 at ₹1,500.00); the next 400 are at ₹1,500.50, above the limit. A DAY limit order fills 350 at an average of ₹1,499.71 and leaves 150 waiting in the book. An IOC order fills the same 350 and cancels 150 at once. A FOK order fills nothing and cancels all 500.

How an IOC order works

  1. You send a buy or sell with IOC validity, usually with a limit price; IOC can also be combined with a market order.
  2. The exchange matches it at once against orders already in the book, at your limit or better.
  3. Whatever quantity matches is filled; the rest is cancelled straight away and never rests in the book.
  4. Your order status shows the filled quantity and the cancelled quantity.

Worked example: what a partial fill does to risk

Using Figure 1: the IOC buy of 500 at ₹1,500 fills 350 at an average of ₹1,499.71 and cancels 150. Say your plan had a stop at ₹1,480, sized for 500 shares at ₹1,500: (1,500 − 1,480) × 500 = ₹10,000 of risk. With 350 filled, the real risk is the ₹5,24,900 paid minus 350 × ₹1,480 (₹5,18,000) = ₹6,900. The target leg must also be for 350 shares, not 500. A DAY limit would have filled the same 350 and left 150 waiting, which might fill later at ₹1,500 or not at all.

Filled
350 @ ₹1,499.71
Cancelled
150
Planned risk (500 shares)
₹10,000
Actual risk (350 shares)
₹6,900

When traders use IOC

IOC limit

Takes what is there now up to your price. Nothing left behind to fill later by surprise.
Good for: fast entries, exits in thin strikes

DAY limit

Fills what it can and waits in the book for the rest until the session ends.
Good for: patient entries at a level
  • Scalpers and momentum traders use IOC limits so a missed entry does not turn into a late fill after the move has gone.
  • Exiting a thin option strike with an IOC limit caps how far below the screen price you sell, without leaving a stale order.
  • Algorithmic and API traders use IOC so every order is resolved at once, which keeps the position state simple.
For traders in India
NSE offers two order validities, DAY and IOC, in cash and F&O, and most broker order windows show both. Brokerage at most brokers is charged on executed orders, so an IOC that fills nothing usually costs nothing; check your broker’s pricing. Statutory charges such as STT apply only to what fills.

Limits and journal notes

  • IOC does not improve the price available; it only stops the order waiting. In a thin book it may fill little or nothing.
  • A partial fill changes your position size. Log requested and filled quantity for every IOC so risk in R is calculated on the real size.
  • Count IOC orders that filled zero or partly per week. A high share means the limit is too tight for the instrument or the size is too large.

Reference guide

ContextValueReading
IOC limit on a fast entry or exitPrice capped, no stale orderYou never pay beyond the limit and nothing is left waiting
Partial fill not noticedSize mismatchCheck filled quantity and resize the stop and target before moving on
IOC in a thin option strikeOften unfilledThe order can cancel with zero filled; widen the limit within plan or wait

Questions

What is an IOC order?

An order that fills as much as it can immediately and cancels any quantity that does not fill. Nothing is left waiting in the order book.

What is the difference between IOC and DAY orders?

A DAY order rests in the book until the session ends if it does not fill at once. An IOC order cancels any unfilled quantity immediately.

What is the difference between IOC and FOK?

IOC allows partial fills and cancels the rest. FOK fills only if the whole quantity is available at once; otherwise nothing fills. NSE offers IOC but not FOK as a standard validity.

Can an IOC order be a market order?

Yes. An IOC market order takes whatever is available at the best prices right now and cancels the rest. An IOC limit adds a price cap.

Do I pay brokerage on a cancelled IOC order?

Most brokers charge only on executed quantity, so a fully cancelled IOC usually costs nothing. Check your broker’s pricing to be sure.

Related terms