MetaTrader FOK vs IOC vs Return: Why One Order Fills Partially and Another Is Rejected
MetaTrader 5 Fill or Kill (FOK), Immediate or Cancel (IOC) and Return order policies specify what happens when the full requested quantity cannot be executed immediately. FOK requires the complete specified volume or rejects/cancels the order. IOC may fill available volume and cancel the remainder. Return may retain unfilled volume for later execution where the instrument and execution mode permit it. These policies are not identical to the order’s protective Stop Loss or its acceptable price.
MetaQuotes’ official trade-operation reference and symbol specification help explain the definitions and which modes are available. In particular, Return is not allowed in MT5’s Market Execution mode, and different servers constrain permitted policies. This article focuses on actual partial fills and rejection evidence rather than repeating our separate ‘Off Quotes’ diagnostics.
| Item | Rule / quantity | Outcome |
|---|---|---|
| Available executable volume | 0.60 lots | Trader requests 1.00 lot |
| FOK | Reject/cancel | 0 filled |
| IOC | 0.60 potentially filled | 0.40 cancelled |
| Return (if supported) | 0.60 potentially filled | 0.40 may remain working |
Illustrative mechanics. The actual contract, order book and brokerage rules govern live outcomes.
What happens to a 1.00-lot request when only 0.60 is eligible?
Assume an exchange-eligible symbol has only 0.60 lots immediately offered at prices satisfying the order’s conditions, while the trader requests 1.00 lot. Under FOK the full 1.00 is not immediately available, so the order will not execute. Under IOC the 0.60 may execute and the 0.40 remainder is cancelled. Under Return, where permitted, available volume may execute and the remaining 0.40 can continue to be processed under the order rules.
These are simplified volume mechanics; actual price levels, exchanges, matching priority and whether an execution mode permits Return still matter. Do not assume Return always guarantees the residual eventually fills or that FOK can only match one counterparty—MetaQuotes notes that FOK’s complete quantity may be filled through multiple offers available at the moment.
Why Return is unavailable for some market orders
MT5 distinguishes Request, Instant, Market and Exchange execution models. The server specifies what filling policies are supported for the precise instrument and execution mode. Return generally is not available for Market Execution, so an EA hardcoded to use Return can receive an invalid filling-type response even when margin and quote are otherwise valid. An order sent to another broker may work because that broker lists different permissions.
Market Watch → Specification shows available filling policies and symbol trade conditions. Don’t ‘fix’ an invalid policy error by changing stop level, leverage or account currency; these are separate checks. One-click trading can automatically select a supported policy depending on execution mode, while programmatic requests need to respect symbol availability.
How IOC partial fills change the actual open position
Suppose the trader attempts a 1.00-lot buy and 0.60 is executed. The position now reflects the actual 0.60 lot fill, not the original ticket quantity. If one full lot would have a hypothetical $10 per pip sensitivity for EUR/USD, the executed volume instead has approximately $6 per pip of USD P/L sensitivity before costs, assuming the standard 100,000 EUR-per-lot convention.
Submitting a replacement order for the full 1.00 without checking history can leave 1.60 lots open if the second request fully executes. The maximum remaining quantity relative to the original intention is 0.40, but a new trade is not automatically appropriate without evaluating price, spread and risk. For a separate stock market example of this problem, see partially filled stock orders.
Book or Cancel is a fourth policy worth recognising
MT5 also documents Book or Cancel (BOC), a passive placement policy that cancels an order if it would execute immediately rather than resting in a depth-of-market book. It is distinct from FOK, IOC and Return. BOC may be supported only for relevant limit or stop-limit order types and matching systems; a retail OTC forex dealer need not offer it.
A trader looking for passive liquidity provision cannot assume a buy limit placed above the current Ask will qualify as passive. Whether the server accepts it depends on BOC availability and price crossing rules. The policy does not remove adverse selection, exposure or trading fees.
Don’t confuse fill policy with order duration or a stop
A stop-loss defines a condition to seek exit, a market or limit order defines execution style, and a fill policy dictates acceptance of partial quantity. Separately, Good Till Cancelled or a specified expiration governs how long an eligible pending order remains active. A Return policy does not imply unlimited lifetime, and an IOC order does not guarantee a particular price.
If an order has an attached protective stop, verify whether it was accepted on the actual executed position, especially after a partial fill or order reversal. A successful trade request can still leave the account with a different size than expected. MetaTrader netting and hedging modes can affect which position receives later changes; see the MT5 account accounting guide.
How to diagnose an EA order rejected for its fill type
- Retrieve the symbol’s live specification for the exact broker server and suffix.
- Check the execution mode and list of supported FOK, IOC, Return or BOC policies.
- Inspect the rejected order’s return code and requested filling policy in the EA Journal.
- Determine whether the EA was coded for another broker or instrument.
- Test a supported policy with virtual funds and verify any partial-fill event handling.
- Reconcile actual position size, pending residuals and protected stops after each accepted deal.
- Do not increase position size on a retry to ‘make up’ a missed trade without recomputing total exposure.
For errors about price freshness and requotes, use MT5 Off Quotes and Requote troubleshooting. For invalid stop distances and margin, consult the separate order validation guide.
Why fill-policy choice is an implementation requirement, not an edge
A backtest that assumes every one-lot request fully executes at a chosen price can overstate volume and profitability for a strategy trading thin markets. Real partial fills require recalculating notional, average fill price, commission and remaining stop exposure. FOK may avoid unwanted incomplete executions but at the cost of missed entry; IOC can take partial available size; Return can leave an order live when that is permitted.
None of these policies makes a strategy profitable. They define the trade-offs between immediate full execution, partial execution and continued order interest under the actual exchange/broker conditions.
A fill-policy audit after a partial execution
| Event | Expected observation under illustrative IOC |
|---|---|
| Order requests 1.00 lot | Instruction submitted subject to available size |
| 0.60 lot eligible immediately | A 0.60-lot execution can appear in deal history |
| 0.40 cannot execute immediately | Remaining volume cancelled under IOC |
| Trader sees ‘order completed’ | Does not prove 1.00 lot actually filled; verify deals |
When assessing an EA, test whether a partial fill triggers correctly scaled stops and take-profit orders. A robot that calculates risk from the originally requested size rather than the actual executed volume can misstate both the current exposure and the size of future closing orders. This operational risk can occur even if the signal generation logic was valid.
Why the same EA runs on one broker but not another
Different MT5 brokers can attach different execution modes to EURUSD, an index CFD or an exchange future. An EA hardcoded to an unsupported fill policy can fail when transferred, while a manually placed order might work because the terminal automatically selects a permitted mode. Copying the code unchanged does not copy the source broker’s symbol definitions or market access.
The robust diagnostic is to query the live symbol configuration and choose only permitted fill policies according to the strategy’s explicitly tested design. If the desired partial-fill behaviour cannot be represented on that venue, mark the instrument unsupported rather than silently substituting an execution policy that changes the strategy. A simulated test that assumes every order fills completely is not a substitute for verifying the real broker’s permissions.
Frequently asked questions
What does FOK mean on MetaTrader?
Fill or Kill requires full requested volume immediately or the trade is not executed.
Does IOC always fill something?
No. It can fill only available eligible volume; if none exists it may fill zero and cancel the rest.
Can Return be used in all MT5 Market Execution requests?
No. MT5’s documented Market Execution model does not permit Return.
Does Return guarantee that unfilled volume trades eventually?
No. It may remain active according to applicable order and expiry conditions but can still go unfilled.
What is BOC in MetaTrader?
Book or Cancel is a passive execution condition that prevents an order from immediately matching when applicable.
Official platform sources
- MT5 Basic Principles: fill-policy definitions
- MT5 Market Watch: permitted filling policies per symbol
Education only: Examples are fictitious and not personal trading recommendations. Confirm specific brokerage rules and full market, leverage and operational risk.
Stay Ahead of the Markets
Get market analysis, financial news and practical trading insights delivered straight to your inbox.