Your EA Asked to Trade. MT5 Replied 'Invalid Filling' (10030).

Your EA Asked to Trade. MT5 Replied 'Invalid Filling' (10030).

2 November 2026, 00:28
Lee Kai Lun
0
32

Picture a perfectly ordinary hypothetical Tuesday.

An Expert Advisor spots its entry. AutoTrading is enabled. The symbol is available. The EA sends a Buy request and waits for a trade.

MT5 responds with 10030: Invalid order filling type.

No trade. No dramatic market crash. Just a tiny administrative disagreement between the robot and the trade server.

Here is the useful answer first: 10030 is a trade-server return code indicating that the order requested a filling policy that is not allowed for that trade. It does not, by itself, prove the EA's strategy is wrong or that the broker has banned automated trading.

The EA might know when it wants to trade. But it also has to ask how the requested volume should be filled.

The hidden instruction inside a Buy order

When an EA sends a market order, it is not only asking to buy or sell. It can also specify what should happen if the full requested volume cannot be executed immediately.

Three filling policies matter here:

  • FOK (Fill or Kill): Execute the entire requested volume or do not fill the order.
  • IOC (Immediate or Cancel): Execute whatever volume is available immediately, if any, and cancel the remainder.
  • Return: If partially filled, leave the remaining volume for further processing where that policy is permitted.

Suppose, purely for illustration, an EA requests 1.00 lot and only 0.60 lot is immediately available under the relevant execution conditions.

With FOK, the order would not receive a partial 0.60-lot fill. With IOC, 0.60 lot could execute and the remaining 0.40 lot would be canceled. With Return, the remainder could continue to be processed, but only where Return is allowed.

Same signal. Same requested size. Different execution instructions.

This is why changing filling mode is not just fixing a spelling mistake. It can affect how much of an intended position actually opens.

Why the same EA can work on one broker and fail on another

Imagine moving an EA from one XAUUSD account to another.

The chart loads. The settings look familiar. The EA sends exactly the same type of trade request. Yet the new account rejects it.

One possible reason is that the symbol's execution settings differ.

MT5 supports Request, Instant, Market and Exchange execution modes. They do not all permit the same filling choices.

For immediately executed market orders, the important rules are:

Execution mode FOK IOC Return
Request Allowed Allowed Allowed
Instant Allowed Allowed Allowed
Market If permitted by symbol If permitted by symbol Not allowed
Exchange If permitted by symbol If permitted by symbol Allowed

The classic trap is Return on a symbol using Market Execution. That combination is not permitted for an immediately executed market order.

Another trap is assuming IOC is the universal cure. It isn't. Under Market or Exchange execution, the symbol must actually permit IOC. FOK has the same kind of symbol-specific restriction.

And yes, MT5 also has Book or Cancel (BoC), but that is a passive policy for supported limit and stop-limit orders, not a fourth general-purpose fix for market Buy and Sell requests.

Before changing settings, inspect the evidence

If 10030 appears, resist the temptation to adjust five EA inputs and hope the sixth attempt behaves.

Try this instead.

1. Read the rejection. Open MT5's Toolbox, then inspect the Experts and Journal tabs around the failed trade. Confirm the exact message and time. A trade-server return code is more informative than a vague impression that the EA “stopped working.”

2. Identify the exact symbol and account. XAUUSD on one account is not automatically configured like XAUUSD, GOLD or a suffixed symbol on another. Check the instrument actually used by the EA.

3. Inspect the symbol specification. In Market Watch, right-click the symbol and open Specification. Review the execution and available filling information, where shown. The broker's symbol settings matter more than what worked last month.

4. Check what the EA requests. If the EA offers a filling-mode input, compare it with the symbol's permitted behavior and the EA's documentation. If it offers no such input, the filling policy may be chosen internally. Randomly changing lot size, stop-loss distance or grid spacing does not directly correct an incompatible filling policy.

5. Test the specific correction on demo. Confirm the request is accepted, then inspect the actual execution result. If IOC is involved, check whether partial fills can occur and whether the EA handles them correctly.

A successful request is not a profitability certificate. It only tells you that this particular execution hurdle has been cleared.

A small note for EA developers

The filling policy is supplied through the type_filling field of MqlTradeRequest .

Two useful symbol properties are SYMBOL_TRADE_EXEMODE (execution mode) and SYMBOL_FILLING_MODE (permitted volume-filling flags). The standard CTrade class also offers SetTypeFillingBySymbol() to help select a filling policy from the symbol's settings.

But do not stop at selecting a value. Check the actual trade result and its retcode . An OrderSend() call returning true does not, by itself, guarantee that the requested trade was fully executed.

One detail deserves its own warning: pending orders are different. MetaQuotes specifies Return for pending orders regardless of the symbol's execution mode, because those orders are not intended for immediate execution when submitted. Do not copy the market-order rules into pending-order handling without checking the distinction.

A robust EA should make a compatible choice for the actual symbol, execution mode and request type, then handle the server's response rather than assuming every broker speaks the same dialect.

Three conclusions to avoid

“My broker blocked my robot.” Maybe there are other restrictions, but 10030 specifically points to an invalid filling policy. Diagnose that before making a bigger accusation.

“I'll force IOC everywhere.” That may produce another rejection on a symbol where IOC is not permitted, and partial-fill behavior may not match the strategy's assumptions.

“It worked in a backtest, so execution settings must be fine.” A historical strategy test does not replace checking the actual trade request against the destination account's current symbol settings.

The takeaway

When MT5 returns 10030, don't begin by rewriting the strategy.

Start with the order request: Which filling policy did the EA ask for, and which policies does this symbol allow for that kind of order?

Your trading logic may be ready for the market. The trade server is simply insisting that you complete the execution paperwork correctly.