Source code
Fix unsupported filling mode in an MQL5 EA
An unsupported filling policy can cause a trade request to be rejected even when the symbol and lot size are valid. FOK, IOC and Return are execution policies, not interchangeable labels.
Check the symbol contract
Inspect the symbol’s execution mode and supported filling flags. Avoid copying a numeric enum value from an unrelated account. A market request and a pending order may need different handling.
Use the platform helper deliberately
When using CTrade, SetTypeFillingBySymbol can choose a policy from the symbol’s settings. Check its result and the subsequent trade result. A successful configuration step is not evidence of a completed trade.
Compare two small test cases
Keep a record of symbol, request type, requested filling policy and returned code. Verify the correction on the same broker environment that produced the error, then check any other supported broker separately.
Make portability a visible feature
A well-organised source project places broker-specific execution handling in one place. That makes future changes easier to understand than repeatedly editing every order call.
Start with a free editable EA project · Explore MQLume source code
Back to top