CFDs and forex are complex instruments and come with a high risk of losing money rapidly due to leverage. Risk disclosure

Fill or kill and immediate or cancel (FOK and IOC)

This page explains what FOK and IOC orders are, how they differ, and where you will see the terms.

Extrade Pakistan editorial team ·

On this page
  1. Definition
  2. Formal definition and edge cases
  3. Worked example (hypothetical)
  4. Where you see the terms
  5. Related terms
  6. Frequent questions

Definition

Fill or kill (FOK) is an execution condition that requires the whole order to be filled at once at the requested price or better, or else the order is cancelled. Immediate or cancel (IOC) fills whatever part of the order can be filled at once and cancels the rest.

Both are "time in force" or "filling" conditions. They tell the trading system what to do when there is not enough volume (liquidity) available at your price at the moment the order arrives.

Sell orders (asks)Buy orders (bids)price1.085604.11.085506.81.085402.41.085305.01.085203.2spread 2.0 pip1.085004.51.084902.91.084806.11.084703.31.084607.2best ask →← best bidA market buy of 9 lots takes thehighlighted asks on three levels.Average fill price: 1.08527
Depth of market: the volume waiting at each price. A large order moves through several levels, so its average price is worse than the best quote. Illustrative example: made-up numbers for learning, not real prices or a broker's conditions.

Formal definition and edge cases

Worked example (hypothetical)

A trader sends a buy order at a limit price. At that moment, sellers are offering only part of the requested size at that price or better.

Condition What happens
FOK Nothing is filled. The whole order is cancelled. The trader has no position.
IOC The available part is bought at once. The remainder is cancelled. The trader holds a smaller position than requested.
No such condition (resting limit order) The available part fills, and the rest waits in the book until it fills, expires or is cancelled.

The trader's margin and risk now depend on the volume that was actually filled. Check that volume before setting a stop-loss. Leveraged forex and CFD trading can lose money fast, and an unexpected position size is one way losses grow. See risk management.

Where you see the terms

Frequent questions

What is the difference between a FOK order and an IOC order?

Both execute immediately. FOK accepts only a complete fill, while IOC accepts a partial fill and cancels the rest.

Can an IOC order stay open in the order book?

No. Any volume that is not filled at once is cancelled.

Does FOK guarantee my price?

It guarantees that you get the requested price or better if the order is filled. It does not guarantee that the order is filled at all.

Why was my order rejected with FOK?

The full volume was not available at your price at that moment. Check the symbol's allowed filling types in the platform.

Is one condition better than the other?

Neither is better in general. They control different outcomes, and the choice depends on whether a partial position is acceptable to you.

Related pages