Skip to content
FXNook HubBeta
0

Common MetaEditor errors and what they mean

'X' - undeclared identifier
A variable or function name is unknown. Check spelling and case, and whether it is declared before use. In MT5, MT4 functions like OrderSend(...) with 11 arguments or iMA(...) returning a value do not exist in the same form.

possible loss of data due to type conversion
A warning, not an error: for example a double stored in an int. Cast on purpose: int bars = (int)MathRound(x);

return value of 'OrderSend' should be checked
MT4 warning. Store the ticket and handle -1 with GetLastError().

'}' - unexpected end of program / unbalanced parentheses
A brace or bracket is missing. MetaEditor points to the end of the file; the real problem is usually higher up.

array out of range (at run time)
An index went past the array size, often i+1 on the oldest bar. Check loop limits against rates_total.

Stuck? Post the code and the message here, or open the file in the Lab and use Check & fix.

0 comments

0 comments

Sign in to join the conversation.

No comments yet. Be the first.