YI GOLD

MT4 / MT5 Error Codes & Trading Tools

Search official trade, runtime and compilation codes and warnings. Calculate risk using actual contract specifications.

Position & Risk

Size exposure using equity, stop distance and actual specifications.

Open calculator
Advanced contract parameters

Margin & Value

Estimate margin, tick value and price-move value.

Open calculator
Advanced contract parameters

Compound & Drawdown

A mathematical scenario, not a forecast of strategy returns.

Open calculator

Calculations run locally in your browser. Inputs are not uploaded or saved. Terminal and broker margin rules apply; estimates exclude slippage, commission and swap.

Official error code lookup

1171 matching records

Platform / categoryCode / constantOfficial meaningTroubleshooting
MT5 · Compilation errors401 Inheritance from the class is impossible, since it is declared with the final specifier
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors402 Cannot redefine a method declared with the final specifier
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors403 The final specifier can be applied only to virtual functions
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors404 The method marked by the override specifier actually does not override any base class function
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors405 A specifier is not allowed in defining a function, but only in declaring
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors406 Cannot cast the type to the specified one
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors407 The type cannot be used for a resource variable
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Compilation errors408 Error in the project file
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Compilation errors409 Cannot be used as a union member
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors410 Ambiguous choice for the name, the usage context should be explicitly defined
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors411 The structure cannot be used from DLL
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors412 Cannot call a function marked by the delete specifier
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Compilation errors413 MQL4 is not supported. To compile this program, use MetaEditor from your MetaTrader 4 installation folder
YI GOLD suggestions

Locate the first reported line in MetaEditor. Check syntax, types, function signatures, includes and file permissions, then recompile.

MetaQuotes
MT5 · Runtime errors0 ERR_SUCCESSThe operation completed successfully
YI GOLD suggestions

Do not treat this as a failure. Still check the function return value and operation state.

MetaQuotes
MT5 · Runtime errors4001 ERR_INTERNAL_ERRORUnexpected internal error
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4002 ERR_WRONG_INTERNAL_PARAMETERWrong parameter in the inner call of the client terminal function
YI GOLD suggestions

Compare each argument and reference mode with the official signature. Validate ranges and preserve relevant failure context.

MetaQuotes
MT5 · Runtime errors4003 ERR_INVALID_PARAMETERWrong parameter when calling the system function
YI GOLD suggestions

Compare each argument and reference mode with the official signature. Validate ranges and preserve relevant failure context.

MetaQuotes
MT5 · Runtime errors4004 ERR_NOT_ENOUGH_MEMORYNot enough memory to perform the system function
YI GOLD suggestions

Reduce recursion and large local arrays, review allocation/release, batch history processing and check memory-operation results.

MetaQuotes
MT5 · Runtime errors4005 ERR_STRUCT_WITHOBJECTS_ORCLASSThe structure contains objects of strings and/or dynamic arrays and/or structure of such objects and/or classes
YI GOLD suggestions

Check length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access.

MetaQuotes
MT5 · Runtime errors4006 ERR_INVALID_ARRAYArray of a wrong type, wrong size, or a damaged object of a dynamic array
YI GOLD suggestions

Check length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access.

MetaQuotes
MT5 · Runtime errors4007 ERR_ARRAY_RESIZE_ERRORNot enough memory for the relocation of an array, or an attempt to change the size of a static array
YI GOLD suggestions

Check length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access.

MetaQuotes
MT5 · Runtime errors4008 ERR_STRING_RESIZE_ERRORNot enough memory for the relocation of string
YI GOLD suggestions

Reduce recursion and large local arrays, review allocation/release, batch history processing and check memory-operation results.

MetaQuotes
MT5 · Runtime errors4009 ERR_NOTINITIALIZED_STRINGNot initialized string
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4010 ERR_INVALID_DATETIMEInvalid date and/or time
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4011 ERR_ARRAY_BAD_SIZETotal amount of elements in the array cannot exceed 2147483647
YI GOLD suggestions

Check length, bounds, dynamic-array declarations and ArraySetAsSeries. Validate returned element counts before access.

MetaQuotes
MT5 · Runtime errors4012 ERR_INVALID_POINTERWrong pointer
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4013 ERR_INVALID_POINTER_TYPEWrong type of pointer
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4014 ERR_FUNCTION_NOT_ALLOWEDFunction is not allowed for call
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4015 ERR_RESOURCE_NAME_DUPLICATEDThe names of the dynamic and the static resource match
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Runtime errors4016 ERR_RESOURCE_NOT_FOUNDResource with this name has not been found in EX5
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Runtime errors4017 ERR_RESOURCE_UNSUPPORTED_TYPEUnsupported resource type or its size exceeds 16 Mb
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Runtime errors4018 ERR_RESOURCE_NAME_IS_TOO_LONGThe resource name exceeds 63 characters
YI GOLD suggestions

Check permitted terminal sandbox paths, names, access flags, formats and handles. Record open failures without granting permissive directory access.

MetaQuotes
MT5 · Runtime errors4019 ERR_MATH_OVERFLOWOverflow occurred when calculating math function
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4020 ERR_SLEEP_ERROROut of test end date after calling Sleep()
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4022 ERR_PROGRAM_STOPPEDTest forcibly stopped from the outside. For example, optimization interrupted, visual testing window closed or testing agent stopped
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4023 ERR_INVALID_TYPEInvalid type
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4024 ERR_INVALID_HANDLEInvalid handle
YI GOLD suggestions

Inspect terminal logs and the failing function return value. Check inputs, array bounds, resources, connectivity and required permissions against the official description.

MetaQuotes
MT5 · Runtime errors4025 ERR_TOO_MANY_OBJECTSObject pool filled out
YI GOLD suggestions

Verify chart ID, object existence and property types. Check creation/update results and avoid name collisions.

MetaQuotes
MT5 · Runtime errors4101 ERR_CHART_WRONG_IDWrong chart ID
YI GOLD suggestions

Verify symbol, timeframe, indicator handle, BarsCalculated and copied element counts. Wait for data availability rather than filling missing prices with zeros.

MetaQuotes
MT5 · Runtime errors4102 ERR_CHART_NO_REPLYChart does not respond
YI GOLD suggestions

Verify symbol, timeframe, indicator handle, BarsCalculated and copied element counts. Wait for data availability rather than filling missing prices with zeros.

MetaQuotes

Official meanings and YI GOLD suggestions are presented separately. References are verified during version builds; page visits do not fetch external sites.