# What Is an Immediate or Cancel Order (IOC)?

> **Definition**
>
> An Immediate or Cancel Order (IOC) executes immediately, filling all or part of the order, and cancels any remaining unfilled portion.

## What Is an IOC?

An immediate or cancel order (IOC) is an order to buy or sell a security that will [execute](https://www.investopedia.com/terms/e/execution.asp) all or part immediately and then cancel any unfilled portion of the order. An IOC order is one of several "duration," or [time-in-force](https://www.investopedia.com/terms/t/timeinforce.asp) orders, that investors can use to specify how long the order remains active in the market and under what conditions the order is canceled.

Other commonly used duration order types include [fill or kill](https://www.investopedia.com/terms/f/fok.asp) (FOK), [all or none](https://www.investopedia.com/terms/a/aon.asp) (AON), and good ‘till canceled (GTC). Most online trading platforms allow IOC orders to be placed manually or programmed into automated trading strategies.

### Key Takeaways

*   Immediate-or-cancel (IOC) orders attempt to execute immediately and cancel any unfilled portion.
*   IOC orders only require a partial fill and may be designated as limit or market orders.
*   IOC is a duration order type like fill or kill (FOK), all or none (AON), and good ‘till canceled (GTC).

## How IOC Works

Investors can submit either a “[limit](https://www.investopedia.com/terms/l/limitorder.asp)” or “market” immediate or cancel order (IOC) depending on their specific execution requirements. An IOC limit order is entered at a particular price, whereas an IOC market order has no price attached and transacts with the best offer price for a buy and the best [bid price](https://www.investopedia.com/terms/b/bidprice.asp) for a sell.

IOC orders differ from other duration orders in that they only require a partial fill, whereas both FOK and AON orders must be filled in their entirety or canceled. GTC orders remain active until executed in the market or canceled by the client, although most brokers cancel them between 30 and 90 days.

## When To Use an IOC Order

Investors typically use IOC orders when submitting a large order to avoid having it filled at varying prices. An IOC order automatically cancels any part of the order that doesn’t [fill](https://www.investopedia.com/terms/f/fill.asp) immediately. Assume a trader places an IOC order to purchase 5,000 shares of International Business Machines Corporation ([IBM](https://www.investopedia.com/markets/quote?tvwidgetsymbol=ibm)). Any portion of the 5,000 shares not purchased immediately is automatically canceled. Those who trade several stocks throughout the day may use an IOC order to minimize the risk of forgetting to cancel an order at the close.

> **Tip**
>
> IOC orders help investors to limit risk, speed execution and provide price improvement by providing greater flexibility.

## Example

Suppose an investor places an IOC market order to buy 1,000 shares of Apple Inc. ([AAPL](https://www.investopedia.com/markets/quote?tvwidgetsymbol=aapl)). The [order book](https://www.investopedia.com/terms/o/order-book.asp) shows 2,000 shares bid at $170.95 and 500 shares offered at $171.00. The order would immediately fill 500 shares at the offer price ($171) and cancel the unfilled portion of 500 shares.

Let's assume another investor places an IOC limit order to buy 1,000 shares of Apple at $169 around the market open when the stock is currently offered at $170. The [S&P 500](https://www.investopedia.com/ask/answers/040215/what-does-sp-500-index-measure-and-how-it-calculated.asp) drops slightly in the afternoon and a seller offers 700 shares of AAPL at $169. The IOC order, however, would not be filled because it was canceled immediately after not being filled earlier in the day.

## What Are the Benefits of Using IOC?

IOC limit orders protect against getting a bad fill in a fast-moving or [illiquid](https://www.investopedia.com/terms/i/illiquid.asp) market. On the other hand, IOC market orders ensure a complete or partial execution in a strongly trending stock with heavy buying demand.

## How Does IOC Affect Market or Limit Orders?

A market order is an order to buy or sell a stock at the best available price and will be executed immediately. A limit order is an order to buy or sell a stock at a certain price or better. Market and limit orders may include timing restrictions and other trading instructions like IOC. 

## What Does Time in Force Mean for Market Traders?

Traders use [time-in-force](https://www.investopedia.com/terms/t/timeinforce.asp) instructions when placing a trade to indicate how long an order will remain active before it is executed or expires.

## The Bottom Line

An immediate or cancel order (IOC) is an order to buy or sell a security that will execute all or part immediately and then cancel any unfilled portion of the order, using time-in-force instructions. IOC limit orders protect investors during a fast-moving market. IOC market orders ensure a complete or partial execution in a strong market with high demand.

> **Article Sources**
>
> 1.  U.S. Securities and Exchange Commission. "[Understanding Order Types](https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-14)."