MT5 · code and request checks
MT5 error 10030 unsupported filling mode
Check the symbol flags before changing type_filling. A flag value of 2 means IOC is supported. It does not mean you should send ORDER_FILLING_RETURN, whose enum value is also 2.
Arnold Holm · 2026-10-04 · Source-backed checks, no trading-result promise.
What the error means
10030 is TRADE_RETCODE_INVALID_FILL: the server rejected the requested filling policy. An EA is a program that applies your trading rules in MetaTrader. This error concerns its order request, not whether the trading rule would make money.
Three code paths to check
1. Symbol flags used as an order enum
SYMBOL_FILLING_MODE is a bitmask. Test it with SYMBOL_FILLING_FOK or SYMBOL_FILLING_IOC, then assign the matching ORDER_FILLING enum. Casting the whole bitmask to ENUM_ORDER_TYPE_FILLING mixes two different sets of values.
2. A policy copied from another symbol or account
Read both SYMBOL_TRADE_EXEMODE and SYMBOL_FILLING_MODE for the actual request symbol. For an immediate market order, RETURN is not allowed under Market Execution. A setting that worked elsewhere is not evidence for this symbol.
3. The market-order path reused for a pending order
Pending orders use RETURN under the documented standard pending-order path. Keep that path separate from immediate BUY/SELL deals. Passive Book-or-Cancel orders need their own constraints and are outside the small pattern below.
Own pattern: validate the intended policy without sending an order
Pass the policy your rule actually needs. This helper leaves the request unchanged if that policy is not allowed or the symbol properties cannot be read. It does not switch silently from full-volume FOK to partial-volume IOC, retry a rejected request or place a trade.
bool TrySetDealFilling(MqlTradeRequest &request,
ENUM_ORDER_TYPE_FILLING intended)
{
if(request.action != TRADE_ACTION_DEAL ||
(request.type != ORDER_TYPE_BUY &&
request.type != ORDER_TYPE_SELL)) return false;
long execution = 0, flags = 0;
if(!SymbolInfoInteger(request.symbol, SYMBOL_TRADE_EXEMODE, execution) ||
!SymbolInfoInteger(request.symbol, SYMBOL_FILLING_MODE, flags))
return false;
bool allowed = false;
if(intended == ORDER_FILLING_RETURN)
allowed = execution != SYMBOL_TRADE_EXECUTION_MARKET;
else if(intended == ORDER_FILLING_FOK || intended == ORDER_FILLING_IOC)
{
if(execution == SYMBOL_TRADE_EXECUTION_INSTANT ||
execution == SYMBOL_TRADE_EXECUTION_REQUEST)
allowed = true;
else if(execution == SYMBOL_TRADE_EXECUTION_MARKET ||
execution == SYMBOL_TRADE_EXECUTION_EXCHANGE)
{
long flag = intended == ORDER_FILLING_FOK
? SYMBOL_FILLING_FOK : SYMBOL_FILLING_IOC;
allowed = (flags & flag) == flag;
}
}
if(!allowed) return false;
request.type_filling = intended;
return true;
}This is an integration pattern, not a complete EA or a recorded broker execution. Compile it with your authorised source and test the complete request on a demo account. It does not check price, volume, stops, margin, duplicate-order handling or later order state.
Three cases to agree before calling it fixed
Positive case: IOC-only Market Execution symbol
With the IOC symbol flag set, the helper accepts intended IOC and sets ORDER_FILLING_IOC. Record the symbol properties and resulting request; do not interpret the flag value as the order enum.
Negative case: RETURN under Market Execution
The helper returns false and leaves type_filling unchanged. The caller stops this path rather than cycling through policies and risking an unintended retry.
Boundary case: pending order or missing properties
The helper returns false. Use the separate pending-order path or resolve the property read. After a complete demo request, inspect the retcode and the actual order or position, not just a successful function call.
Your own source
Find the next line to check
Start with the free EA-Check. Your code stays in your browser. It highlights patterns with line numbers; it does not prove the broker accepts an order.
Want one small change shown on your own case?
SOLVED-FIRST: one small fix or change to your own case, shown first as screenshots or a short screen video. 15 USD fixed (or the higher platform minimum), first five paid orders only during 4–17 October 2026. The file follows within 24 hours after funding. Close on Upwork first; marketplace cases stay on their marketplace.
Outside that sprint: R49: one authorised, reproducible MT4/MT5 defect, with three agreed cases. 49 USD fixed. Delivery within 48 hours after source review and funding. The exact case is agreed before funded work.
Send the expected and actual behaviourRelated checks
Common questions
Should I force IOC for every 10030 error?
No. Check the actual symbol, execution mode, order type and whether your rule allows partial fills. Replacing the policy everywhere can change what your program does.
Does a clean EA-Check prove this is fixed?
No. The free checker finds source patterns only. A complete request still needs compilation, the three agreed cases and an observed order or position state.
Sources and limits
- Official MQL5 trade-server return codes
- Official symbol filling flags and execution-policy table
- Observed question: flags confused with enums, then corrected
The linked forum case belongs to its author. It is not my customer case or proof that your broker has the same cause. This article covers request behaviour only; it makes no performance or challenge-passing claim.