What Is an Immediate or Cancel (IOC) Order?

By Forex & Brokers DeskUpdated Nov 10, 2026

Immediate or Cancel (IOC) Order
Illustration · Fintrev

Definition

An immediate or cancel (IOC) order executes whatever quantity can fill the moment it reaches the market and cancels any unfilled remainder, so nothing rests on the order book.

Key takeaways

  • IOC is a time-in-force instruction that controls how long an order stays active, not its trade price.
  • An IOC limit buy fills only at the set price or lower and cancels whatever cannot fill at that instant.
  • In the example, a 3.0 lot IOC limit order filled 2.5 lots at an average of 1.08492.
  • Fill or kill cancels the whole order unless it fills in full, while IOC accepts a partial fill.

An immediate or cancel (IOC) order is an instruction to buy or sell that must execute the moment it reaches the market. Whatever quantity can be filled right away is filled, and any part that cannot be filled immediately is canceled. Nothing rests on the order book afterward. IOC is a time-in-force instruction: it controls how long an order stays active, not the price at which it trades. Some venues label the same behavior “fill and kill” (FAK).

How an IOC order works

An IOC instruction sits on top of an ordinary order type, so the first question is whether the order is a limit or a market order.

  • IOC limit order. You set a price. A buy fills only at that price or lower, and a sell fills only at that price or higher. The order takes whatever matching liquidity exists at that instant, up to your size, and cancels the rest.
  • IOC market order. No price is attached. A buy trades against the best available offer and a sell against the best available bid. Any quantity the available liquidity cannot absorb at that moment is canceled instead of being left working in the market.

On MetaTrader 5, IOC appears as a filling policy alongside Fill or Kill and Return. The three differ only in what happens to an unfilled remainder: FOK rejects the whole order unless it fills in full, IOC cancels the remainder, and Return leaves the remainder working as a pending order.

Worked example (hypothetical)

A trader wants to buy 3.0 lots of EUR/USD with an IOC limit order at 1.0850. At the moment the order arrives, the offers available are:

  • 1.0 lot at 1.0848
  • 1.5 lots at 1.0850
  • 2.0 lots at 1.0851

The order fills 1.0 lot at 1.0848 and 1.5 lots at 1.0850, because both prices are at or better than the limit. The 1.0851 offer is above the limit, so the remaining 0.5 lot is canceled.

Filled size: 2.5 lots. Average fill price: (1.0 × 1.0848 + 1.5 × 1.0850) ÷ 2.5 = 1.08492.

If EUR/USD dips back to 1.0850 a minute later with plenty of size offered, nothing happens. The IOC order expired at submission, and the trader has to send a new order to buy the missing 0.5 lot.

Had the same 3.0 lots gone in as an IOC market order on a venue that lets it trade across price levels, the last 0.5 lot would have filled at 1.0851. That gives an average of about 1.08495 and a full fill, at the cost of paying above 1.0850 for part of it.

When traders use IOC orders

Large orders in thin or fast markets. Sending a big limit order that rests on the book can leave it filling piece by piece at different times and prices as the market moves. IOC takes what is available now and cancels the rest, so the trader sees exactly what was executed and can decide what to do next with current information.

Avoiding stale orders. A resting order you forget about can fill hours later in conditions you no longer want. Because an IOC order cannot outlive its submission, there is nothing to cancel at the end of the session. That suits traders who place many orders across several instruments.

Short-lived price opportunities. Strategies that depend on a price being available right now, such as arbitrage between venues or quotes, lose their logic if an order waits and fills later. IOC enforces “now or not at all” without demanding the full size the way FOK does.

Automated execution. Algorithms often send IOC orders so that every order resolves instantly to a known filled quantity. That makes position tracking simpler than managing working orders.

IOC compared with other time-in-force instructions

Instruction Partial fill allowed? How long it stays active
Immediate or cancel (IOC) Yes Only at submission; remainder canceled
Fill or kill (FOK) No Only at submission; whole order canceled unless fully filled
All or none (AON) No Can wait, but executes only for the full size
Day order Yes Until the end of the trading session
Good ’til canceled (GTC) Yes Until filled or canceled (brokers may set a maximum duration)

Day versus IOC is the comparison most often decided at the order ticket. A day limit order to sell keeps working for the rest of the session and can fill if price reaches your level later. An IOC sell executes only against bids available at that instant. Choose IOC when a later fill would be unwelcome. Choose a day order when you are willing to wait for your price.

Limitations of IOC orders

No guarantee of execution. An IOC limit order with a price away from the market simply cancels. In a fast move, even a price close to the market can miss.

Partial fills change your position size. In the example, the trader planned 3.0 lots and holds 2.5. Any stop-loss distance or risk budget calculated for the full size now applies to a smaller position. Rerunning the numbers with a position size calculator shows the actual risk.

IOC market orders trade price risk for fill certainty. Without a limit, the filled portion can execute at worse prices than the top of the book. This is the same slippage exposure any market order carries.

Availability and naming vary. Brokers and platforms differ in which time-in-force options they offer and what they call them. Check the order ticket before relying on a specific behavior.

The Bottom Line

IOC orders suit traders who want a known result right away, such as those placing large orders in thin markets, chasing short-lived prices, or running algorithms. The tradeoff is that execution is never guaranteed and a partial fill leaves a smaller position than planned. Recalculate risk on the size actually filled, and confirm on the order ticket how your broker labels and handles IOC.

About this page

Written by Forex & Brokers Desk

The Forex & Brokers Desk covers forex and CFD broker reviews, regulation checks, trading guides and the forex glossary.

Published
Last updated

Spotted an error? Tell the editors. This page is general information, not financial advice.