MT5 · code and request checks
MQL5 OrderSend wrong parameters count: check the interface first
My MT4-style example failed the MT5 compiler check, so it sent 0 orders. Your first check is the function declaration. I also compiled an unused two-reference wrapper and ran three local structure checks.

Arnold Holm · 2026-10-20
What the error means
A forum author used an MT4-style positional OrderSend call in an MT5 program. The MT5 compiler expected two references: MqlTradeRequest and MqlTradeResult. Changing the number of positional arguments does not turn the MT4 interface into the MT5 interface. First establish which language and compiler own the source. Preserve the exact compiler line and function declaration before changing the trading rules. An interface mismatch is a compile boundary. Permissions, quotes and broker responses become relevant only after a valid program reaches those later steps. The official MQL5 reference defines OrderSend with a request structure and a result structure. Its boolean return is not an MT4 order ticket. A successful return alone does not establish that a trade was executed. The result fields and the subsequent trade lifecycle still need their own handling. My small check keeps those boundaries separate. One original source intentionally uses the wrong signature and is rejected by the compiler. A second original source contains the two-reference wrapper below. Its OnStart never calls that wrapper. The local runtime checks inspect structure fields only. They cannot establish server acceptance, an execution price or a filled order. I check the target language and function signature before changing trading logic.
Three code paths to check
1. An MT4 call was copied into MT5.
Read the declaration for the actual target language. MQL5 OrderSend takes a request reference and a result reference; positional MT4 arguments are a different interface.
2. The returned value was treated as a ticket.
Keep the MQL5 boolean return separate from result.retcode, order and deal fields. Compiling this wrapper proves none of those runtime outcomes.
3. A compile repair was treated as a broker repair.
A valid signature does not establish a valid request. Freeze the intended symbol, volume, action and expected results before implementing and funding a real repair.
A compiled wrapper that the runtime never calls
I compiled the original negative case in native MT5 on 19 October 2026. It produced error 199, wrong parameters count. I then compiled the separate source containing this wrapper. Its runtime does not call OrderSend. The runtime checks were narrower: the initialized request had zero volume, the initialized result had zero retcode, and assigning EURUSD to the request symbol left those two fields at zero. All three fixed comparisons passed. These are local structure checks, not an order request, a broker response or evidence that EURUSD can be traded. The screenshot and local log retain those outcomes. The chart behind the text is terminal background. The forum author's whole EA was not repaired or run. No order, trade history or profit result is represented here.
bool SignatureOnly(MqlTradeRequest &request,MqlTradeResult &result)
{
return OrderSend(request,result);
}One negative compile case, an unused compiled wrapper and three local structure checks. Zero orders; no OrderSend runtime call, OrderCheck, server acceptance, fill or MT4/MT5 strategy identical trading behaviour test.
How you know it is fixed
Keep the compiler boundary visible
Retain the failing line and exact compiler compiler message. Match the call against the declaration for the actual language.
Separate local fields from server results
Initialization and assignment can be checked locally. They must never be labelled as a successful broker request.
Your five-minute source check
Find the OrderSend call named by the compiler. Compare its arguments and return type with the MQL5 declaration before changing strategy conditions.
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?
DEMO0: send the problem and try a free compiled demo first. R49: one authorised, reproducible MT4/MT5 defect in readable source up to 500 lines, 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
Does this wrapper send an order in the proof run?
No. OnStart never calls it. The run only checks local request and result fields.
Did this repair the forum EA?
No. The original local cases isolate a compiler interface boundary. The EA logic and any broker execution remain outside this proof.
Sources and limits
These public questions explain the error; use your own EA log to check whether the same cause applies.