Reference · Order Execution
IOC, FOK and GTC: Order Lifetime and Fill Policies
Compare immediate-or-cancel, fill-or-kill and good-till-canceled instructions while separating order lifetime, partial fills and platform rules.
Published Updated
Published by FxTrusts, a supplier of brokerage and prop firm technology. Prepared with AI-assisted research and drafting; reviewed against the cited public sources. Examples are illustrative. Product links describe our services.
Quick answer
IOC generally permits immediate partial execution and cancels the remainder; FOK requires the full quantity to execute immediately or none. GTC describes an order lifetime until execution or cancellation under the venue’s rules. APIs may represent these concepts differently, so separate lifetime from fill policy.

Ask two questions before reading a label
How long can the instruction remain active, and what quantity may execute? Those questions overlap in some standards but are separate settings in some platforms. FIX supports time-in-force concepts in its messaging model; MetaTrader exposes filling policies and expiration behavior through its own order rules. A mapping layer should preserve the meaning of the requested instruction instead of assuming that similarly named fields are interchangeable across systems.
IOC and FOK handle insufficient quantity differently
Under the conventional definitions used here, an IOC instruction can execute whatever eligible quantity is immediately available and cancel the rest. FOK requires enough eligible quantity to complete the whole instruction immediately. Neither definition overrides the order’s other conditions. A limit price still constrains eligible prices, and venue rules determine how liquidity is assessed. Do not claim a FOK request guarantees a full fill: it can result in no fill.
GTC does not define the entire execution policy
Good till canceled generally keeps an eligible order active beyond the current moment, but a venue can apply maximum lifetimes, session events or corporate-action handling. The label alone does not say whether partial fills are permitted or which prices qualify. An operations record should include order type, price condition, fill policy and expiry together. A platform can also restrict which combinations are available for a specific execution mode or symbol.
Test translations and final states
When routing between APIs, confirm which instruction combinations are accepted and how unsupported requests are rejected. Test insufficient quantity, a partial fill, a session transition and a canceled remainder. Keep the acknowledgment and final state so that a canceled remainder is not reported as a fully canceled order that had no execution. That distinction matters for position reconciliation and for avoiding duplicate replacement orders.
One order, three explicitly different policies
Assume an order requests 100 units within a valid limit and only 40 units are immediately available at eligible prices. The following outcomes are simplified definitions; actual venue handling must be verified. GTC is deliberately shown without a fixed fill result because lifetime alone does not specify all quantity behavior.
| Instruction | Illustrative immediate result | What remains |
|---|---|---|
| IOC | 40 units filled | 60 units canceled |
| FOK | No fill because 100 are unavailable | Entire request canceled |
| GTC with partial fills allowed | 40 units may fill | 60 may remain active under venue rules |
Implementation checklist
- Document lifetime and fill policy as separate concepts even if the API combines them.
- Validate supported combinations for the exact symbol and execution mode.
- Distinguish a canceled remainder from an order with no fills.
- Include session and maximum-lifetime behavior in acceptance tests.
Sources
These documents support the reference. Check the original publication for current requirements and the limits of its scope.
- MetaTrader 5 trading principleswww.metatrader5.com
- FIX Latest as of EP284: Trade specificationwww.fixtrading.org
- FIX Latest as of EP284: Order State Changeswww.fixtrading.org
Continue with the broader guides
Connect this reference to platform selection and the wider operating workflow.
