For educational purposes only; not investment advice. Investing may result in loss.
Direct answer
Immediate-or-Cancel (IOC) instructs the broker or trading venue to attempt execution immediately and cancel any quantity not immediately executed. It normally permits a full fill, a partial fill followed by cancellation of the remainder, or no fill followed by cancellation.
Fill-or-Kill (FOK) instructs the broker or venue to execute the entire specified quantity immediately on acceptable terms or cancel the entire quantity. It prevents a partial fill under the applicable implementation.
IOC and FOK are handling or time-in-force instructions, not price guarantees or promises of execution. Price protection comes from the accompanying order type and limit: a buy limit is the maximum execution price and a sell limit is the minimum. Product, broker, venue, session, routing, and protocol rules determine whether an instruction is supported and exactly what “immediate” and “entire” mean.
How it works
Evaluate the instruction and result in this order:
- Define the instrument and destination. Record symbol or contract, side, total quantity, order type, limit price, IOC or FOK instruction, trading session, account restrictions, broker, route, and venue. Equities, options, futures, and bonds can use different rulebooks and eligible combinations.
- Separate price from time and completeness. A limit order controls the worst acceptable price but does not guarantee a fill. IOC controls how long unfilled quantity remains available and allows partial execution; FOK adds an all-or-none condition plus immediacy. A market IOC can lack a price ceiling, while some venues do not accept market FOK orders.
- Check available executable interest. Compare the order with contra-side prices at or better than its limit, quantity, queue priority, displayed and reserve interest, protected quotes, minimum quantities, and venue-specific matching rules. A screen is a timestamped snapshot, not a reservation.
- Apply venue and routing rules. Some IOC orders may route or sweep eligible venues; others are venue-only. Some FOK implementations can aggregate multiple resting orders, while others require different conditions or do not route. Unsupported combinations can be rejected before matching.
- Determine the execution outcome. An IOC may receive several fills at different acceptable prices and cancel the residue. An FOK executes only if the venue determines that the full quantity can execute immediately under its rules; otherwise it cancels without a trade. Cancellation is an expected outcome, not necessarily an error.
- Reconcile reports and economics. Confirm accepted, rejected, filled, partially filled, canceled, or expired status; executed quantity; each price; weighted-average price; commissions; fees; timestamp; route; and remaining quantity. Do not infer final status from a pending interface message or one fill report.
- Control follow-up and strategy risk. Decide whether to keep a partial IOC position, hedge it, or submit a new order. Use unique order identifiers and current status before resubmitting. Separate orders for two securities or option legs are not atomic merely because each uses IOC or FOK; use a supported complex-order mechanism if simultaneous execution is required.
FOK differs from All-or-None (AON): both generally prohibit partial fills, but AON may remain active under broker and venue rules, whereas FOK demands an immediate all-or-nothing decision. IOC differs from day and good-till-canceled instructions because its unexecuted quantity does not rest in the book after the immediate attempt.
Example
Assume this visible ask-side snapshot: 3,000 shares at $25.0000, 2,000 at $25.0100, 4,000 at $25.0200, and 5,000 at $25.0400.
- IOC limit: a buy IOC for
10,000shares with limit$25.0200can consume the first9,000visible shares and cancel1,000. The illustrative cost is$225,100.0000, soVWAP = $225,100 / 9,000 = $25.0111. Actual fills can be smaller if other orders consume liquidity or venue rules differ before arrival. - FOK at the same limit: a buy FOK for
10,000shares at$25.0200cancels without execution because only9,000shares are shown at acceptable prices. A9,000-share FOK could fill for$225,100.0000under a venue that can aggregate those levels and if the interest remains executable; the snapshot alone does not guarantee it. - Higher FOK limit: raising the
10,000-share buy limit to$25.0400makes enough displayed quantity acceptable in the snapshot. The first10,000shares cost$250,140.0000, givingVWAP = $25.0140and worst fill$25.0400. The limit is a ceiling, not a forecast that every share trades there. - Strategy consequence: if only the IOC’s
9,000shares fill and price later moves to$24.5000, the mark-to-market change is9,000 × ($24.50 - $25.0111) = -$4,600.0000after rounding and before fees. The canceled1,000shares create no position, but the partial holding still creates market and hedge risk.
Risks
- Confirm that the broker, venue, instrument, order type, and session support the requested IOC or FOK combination.
- Record side, quantity, limit, time in force, route, account, and order identifier before submission.
- Use a limit when a worst acceptable price matters; immediacy alone does not provide price protection.
- Recognize that a limit controls execution price but cannot guarantee any execution.
- Treat displayed quotes and depth as changing snapshots rather than reserved liquidity.
- Account for queue priority, hidden or reserve interest, odd lots, minimum quantity, and matching rules.
- Verify whether the order may route, sweep multiple venues, remain venue-only, or be rejected.
- Do not assume every FOK venue aggregates multiple price levels or counterparties in the same way.
- Expect IOC to create a smaller-than-planned position when only part of the quantity executes.
- Expect FOK to produce no trade even when partial liquidity would have been available.
- Distinguish automatic cancellation under the instruction from broker or venue rejection.
- Reconcile every execution price and compute VWAP rather than using the limit or last-traded price as the fill price.
- Include commissions, exchange fees, rebates, taxes, and spread cost in execution economics.
- Monitor latency, rapid quote changes, halts, price bands, auctions, and extended-hours conditions.
- Check short-sale, locate, position-limit, credit, margin, fat-finger, and regulatory controls that can block an order.
- Confirm the final executed and canceled quantities before replacing or resubmitting to avoid duplicate exposure.
- Use unique identifiers and timestamps when broker messages or execution reports arrive out of order.
- Do not assume separate IOC or FOK orders across legs execute atomically; leg risk can remain.
- Compare strict immediacy with alternatives such as AON, minimum quantity, day, GTC, staged execution, or supported complex orders.
- Preserve an order-and-fill audit trail and review whether routing and execution quality matched the strategy’s objective.
Common misconceptions
- “IOC means the whole order executes immediately.” IOC permits partial execution and cancels only the unfilled remainder.
- “FOK is the same as AON.” Both restrict partial fills, but FOK requires an immediate decision while AON may remain active under applicable rules.
- “A limit at the displayed ask guarantees a fill.” Size, queue, routing, latency, and changing quotes can prevent execution.
- “FOK checks all liquidity everywhere.” The broker and venue determine eligible routes, books, counterparties, and aggregation rules.
- “Using IOC or FOK makes a multi-leg strategy atomic.” Independent leg orders can produce incomplete or mismatched positions unless a supported complex mechanism enforces joint execution.
Related topics
Sources
- FINRA: Trading Terms - Time Parameters and Qualifiers on Stock Orders.
- SEC Investor.gov: Types of Orders.
- SEC Investor.gov: Executing an Order.
- FINRA: Market Order vs. Limit Order.
- FINRA: Types of Orders.
- NYSE: NYSE Bonds FIX Gateway Specification.