Retcode 10030 is a compatibility result
An Expert Advisor can calculate its entry correctly and still submit an invalid filling instruction. MetaQuotes assigns code 10030 to TRADE_RETCODE_INVALID_FILL, described as an invalid order filling type [5]. That result should trigger a configuration investigation, not an automatic retry with a larger deviation, a different signal, or a wider protective stop. Those changes address different variables and can add risk without fixing the request.
Preserve the exact MqlTradeRequest fields that produced the response: symbol, action, order type, volume and type_filling, plus the symbol execution mode and the server retcode. The type_filling member is an ENUM_ORDER_TYPE_FILLING value [3]. Without that snapshot, a later successful request cannot show whether the fill policy changed, the symbol settings changed, or an unrelated input happened to differ.
Treat symbol settings as runtime inputs
SYMBOL_FILLING_MODE is an integer property containing the allowed volume-filling flags for an instrument. The official symbol-property documentation explains that multiple permissions can be combined with bitwise OR and tested with bitwise AND [2]. A value copied from another account, broker or instrument is not a reliable capability record. Capture the property at the same time and in the same environment as the test.
Execution mode changes the decision. RETURN is not allowed under SYMBOL_TRADE_EXECUTION_MARKET, regardless of a symbol setting. Under Market Execution, FOK and IOC depend on the symbol flags; the official table gives different availability rules for Instant, Request and Exchange Execution [1, 2]. A reusable EA therefore needs an explicit compatibility decision rather than a global fill-mode constant.
Model the policy before you model the fill
FOK requires the requested volume to be executed in full or not executed. IOC permits the currently available part to execute and cancels the remainder. RETURN keeps a remaining partial volume in processing, subject to its execution-mode restriction. BOC is a passive Book-or-Cancel policy: an immediately executable order is canceled, and only limit and stop-limit order types are supported [1]. These are behavioral choices, not interchangeable syntax.
Consider an explicitly hypothetical request for 2.00 lots when the teaching model makes only 1.25 lots available at the selected price. In a simplified FOK case, the complete request would not execute; an IOC case could execute 1.25 and cancel 0.75. This is invented arithmetic, not a liquidity claim or a prediction of a server outcome. A partial position may break downstream sizing, hedging or exit assumptions, so acceptance alone is not the test objective.
Build a log-only compatibility matrix
Keep AutoTrading disabled. Create rows for each symbol and intended order type, then record SYMBOL_TRADE_EXEMODE, the raw SYMBOL_FILLING_MODE value, individual FOK, IOC and BOC flag checks, and the policy your EA would choose. Add separate rows for market, limit and stop-limit requests. If a property cannot be read or the quote context is stale, label the row as a failed precondition instead of choosing a fallback silently.
Write the expected decision before running the selection function. Include a RETURN-under-Market-Execution rejection, a symbol advertising both FOK and IOC, and a BOC case using an unsupported order type. Compare the calculated allow or reject decision with the expectation and log a reason code. This exercise tests deterministic policy selection; it does not need a demo order, a real account, or a claim about execution quality.
Use preflight tools without overstating them
OrderCheck evaluates a proposed MqlTradeRequest and returns details through MqlTradeCheckResult. The official reference says false can indicate insufficient funds or incorrectly populated parameters, while also warning that a successful basic check does not assure successful execution [4]. Keep preflight validation, request acceptance and completed deals as separate states in test reports. A single green status hides the point at which a failure occurred.
CTrade users can call SetTypeFillingBySymbol to select a policy from the specified symbol settings. The method returns whether it could define the policy; if both FOK and IOC are permitted, its documented choice is FOK [6]. Record that outcome rather than assuming the helper chose the behavior your strategy needs. A convenient library default does not replace review of partial-fill handling or risk limits.
Make filling behavior part of EA due diligence
Before buying an EA or commissioning an audit, ask for evidence that includes the program version, exact symbol settings, chosen fill policy, sample rejects and the handling of partial volume. An equity curve does not answer those questions. An EX5 file can support observable behavior tests, but a complete source review requires the MQ5 code and relevant dependencies. Neither form of review can guarantee future fills or returns.
Your next action is a twelve-row synthetic matrix spanning several order types and permission combinations. Retain rejected and unknown cases alongside passes, then add them to regression testing when the EA changes. Readers who already have a recurring 10030 failure can review BamaUp's EA-audit scope after confirming price and deliverables before purchase. This article provides engineering education, not a signal, a live-order result or performance evidence.