TRADE_RETCODE_INVALID_FILL (10030): Invalid order filling type

MetaTrader 5 returns retcode 10030 when the type_filling you put in the order request is not allowed for that symbol and its execution mode. The fix is to ask the symbol which filling modes it supports and pick one of those.

Official docs opened 2026-11-16. Unsupported filling mode. Plain-English guide, not financial advice.

What the official docs say

MQL5 docs: "10030 TRADE_RETCODE_INVALID_FILL - Invalid order filling type". Order properties docs: SYMBOL_FILLING_MODE gives the allowed filling flags; ORDER_FILLING_RETURN is enabled at all times except in Market execution; FOK and IOC depend on the symbol setting in Market and Exchange execution.

Three common causes

  1. The EA hard-codes ORDER_FILLING_FOK but the broker only allows IOC (or the reverse).
  2. ORDER_FILLING_RETURN was used on a symbol in Market execution mode, where it is disabled.
  3. The same EA runs on several brokers; each broker sets filling flags differently.

How to fix it

  1. Read SYMBOL_FILLING_MODE and SYMBOL_TRADE_EXEMODE with SymbolInfoInteger.
  2. Choose FOK if flag 1 is set, else IOC if flag 2 is set, else RETURN (not in Market execution).
  3. Set request.type_filling to that value before OrderSend.
  4. Pending orders should use ORDER_FILLING_RETURN, as the MQL5 docs state.

MQL5 example (runs as shown with sample numbers):

ENUM_ORDER_TYPE_FILLING PickFilling(const string sym)
{
   long modes = SymbolInfoInteger(sym, SYMBOL_FILLING_MODE);
   long exe   = SymbolInfoInteger(sym, SYMBOL_TRADE_EXEMODE);
   if((modes & SYMBOL_FILLING_FOK) != 0) return ORDER_FILLING_FOK;
   if((modes & SYMBOL_FILLING_IOC) != 0) return ORDER_FILLING_IOC;
   if(exe != SYMBOL_TRADE_EXECUTION_MARKET) return ORDER_FILLING_RETURN;
   return ORDER_FILLING_IOC;   // last resort
}

What the official docs say

ItemOfficial wordingNumber in the docsSource and read date
ORDER_FILLING_FOKFill or Kill: execute the full volume or not at all-Official docs, read 2026-11-16
ORDER_FILLING_IOCImmediate or Cancel: fill what is available, cancel the rest-Official docs, read 2026-11-16
ORDER_FILLING_RETURNReturn: a partly filled order keeps working; not allowed in Market execution-Official docs, read 2026-11-16

Check your numbers

Type the SYMBOL_FILLING_MODE value and pick the execution mode.

Look up MT5 return codes and symbol properties by API: AIKIT (free 1,000 calls)

Disclosure: AIKIT is our own product. It returns sourced exchange and broker rules (with the official source and read date) and checks bot code against them. Facts and checks only, not advice.

Questions people ask

What does MT5 error 10030 mean?

The filling type in your order request is not supported for this symbol.

Which filling mode should I use?

Read SYMBOL_FILLING_MODE and use one of the allowed flags. Do not hard-code one for every broker.

Is it the same on a demo and a live account?

Not always. Brokers can set different modes per account type, so test on the account you will trade.

Sources

Exchange rules change; read the live values from the venue before you trade.

All error fixes. General information for education only. It is not financial advice, and trading can lose money.