Error codes
MetaTrader 5 API error codes
311 decoded error codes for MetaTrader 5 (Python package and MQL5). Each page gives the exact error text and what it means. 68 of them carry a fix or a next step, and each of those rows is marked Fix recorded. Where the source gives no remedy, the page says so.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
Trade server return codes
41 codes
Returned by the trade server to the platform.
TRADE_Fix recorded The price changed and the server offered a new one.RETCODE_ REQUOTE (10004) TRADE_Fix recorded The server rejected the request.RETCODE_ REJECT (10006) TRADE_The request was cancelled by the trader.RETCODE_ CANCEL (10007) TRADE_Fix recorded The order was placed.RETCODE_ PLACED (10008) TRADE_Fix recorded The request was completed.RETCODE_ DONE (10009) TRADE_Only part of the request was completed.RETCODE_ DONE_ PARTIAL (10010) TRADE_The server reports an error in processing the request.RETCODE_ ERROR (10011) TRADE_The request was cancelled because it timed out.RETCODE_ TIMEOUT (10012) TRADE_Fix recorded The trade request is malformed.RETCODE_ INVALID (10013) TRADE_Fix recorded Volume is outside min, max or step for the symbol.RETCODE_ INVALID_ VOLUME (10014) TRADE_Fix recorded The price is not valid.RETCODE_ INVALID_ PRICE (10015) TRADE_Fix recorded Stop loss or take profit is invalid, often too close to price.RETCODE_ INVALID_ STOPS (10016) 10017 TRADE_Trading is disabled.RETCODE_ TRADE_ DISABLED TRADE_Fix recorded The market is closed.RETCODE_ MARKET_ CLOSED (10018) TRADE_Fix recorded Insufficient margin.RETCODE_ NO_ MONEY (10019) TRADE_Fix recorded Prices changed while the request was being handled.RETCODE_ PRICE_ CHANGED (10020) TRADE_There are no quotes to process the request.RETCODE_ PRICE_ OFF (10021) 10022 TRADE_Fix recorded The order expiration date in the request is invalid.RETCODE_ INVALID_ EXPIRATION TRADE_The state of the order changed.RETCODE_ ORDER_ CHANGED (10023) 10024 TRADE_Fix recorded Requests are being sent too often.RETCODE_ TOO_ MANY_ REQUESTS TRADE_Fix recorded The request contains no changes.RETCODE_ NO_ CHANGES (10025) 10026 TRADE_Autotrading is disabled by the server.RETCODE_ SERVER_ DISABLES_ AT TRADE_Fix recorded Algo trading is switched off in the terminal.RETCODE_ CLIENT_ DISABLES_ AT (10027) TRADE_The request is locked for processing.RETCODE_ LOCKED (10028) TRADE_The order or position is frozen.RETCODE_ FROZEN (10029) 10030Fix recorded Invalid order filling type: order_send asked for a filling mode the symbol does not allow.TRADE_Fix recorded There is no connection with the trade server.RETCODE_ CONNECTION (10031) TRADE_Fix recorded The operation is allowed only for live accounts.RETCODE_ ONLY_ REAL (10032) TRADE_The number of pending orders has reached the limit.RETCODE_ LIMIT_ ORDERS (10033) TRADE_The volume of orders and positions for the symbol has reached the limit.RETCODE_ LIMIT_ VOLUME (10034) TRADE_Fix recorded The order type is incorrect or prohibited.RETCODE_ INVALID_ ORDER (10035) 10036 TRADE_Fix recorded The position with the specified POSITION_IDENTIFIER has already been closed.RETCODE_ POSITION_ CLOSED 10038 TRADE_Fix recorded The close volume is larger than the current volume of the position.RETCODE_ INVALID_ CLOSE_ VOLUME 10039 TRADE_Fix recorded A close order already exists for the position.RETCODE_ CLOSE_ ORDER_ EXIST 10040 TRADE_The number of open positions on the account has reached a limit set on the server.RETCODE_ LIMIT_ POSITIONS TRADE_The request to activate a pending order was rejected and the order was cancelled.RETCODE_ REJECT_ CANCEL (10041) TRADE_The request was rejected because the symbol has the rule "Only long positions are allowed" (POSITION_TYPE_BUY).RETCODE_ LONG_ ONLY (10042) TRADE_The request was rejected because the symbol has the rule "Only short positions are allowed" (POSITION_TYPE_SELL).RETCODE_ SHORT_ ONLY (10043) TRADE_The request was rejected because the symbol has the rule "Only position closing is allowed".RETCODE_ CLOSE_ ONLY (10044) TRADE_The request was rejected because the trading account has the flag "Position closing is allowed only by FIFO rule" set (ACCOUNT_FIFO_CLOSE=true).RETCODE_ FIFO_ CLOSE (10045) 10046 TRADE_The request was rejected because the trading account has the rule "Opposite positions on a single symbol are disabled".RETCODE_ HEDGE_ PROHIBITED
Runtime error codes
255 codes
Raised inside the platform's own language.
ERR_Fix recorded The operation completed successfully.SUCCESS (0) ERR_"Unexpected internal error" is MetaQuotes' whole description of this code.INTERNAL_ ERROR (4001) ERR_"Wrong parameter in the inner call of the client terminal function" is MetaQuotes' whole description of this code.WRONG_ INTERNAL_ PARAMETER (4002) ERR_"Wrong parameter when calling the system function" is MetaQuotes' whole description of this code.INVALID_ PARAMETER (4003) ERR_"Not enough memory to perform the system function" is MetaQuotes' whole description of this code.NOT_ ENOUGH_ MEMORY (4004) 4005 ERR_The structure contains strings, dynamic arrays, classes, or structures that hold any of these.STRUCT_ WITHOBJECTS_ ORCLASS ERR_The array is of the wrong type or the wrong size, or the object of a dynamic array is damaged.INVALID_ ARRAY (4006) ERR_There is not enough memory to relocate an array, or the code tried to change the size of a static array.ARRAY_ RESIZE_ ERROR (4007) ERR_"Not enough memory for the relocation of string" is MetaQuotes' whole description of this code.STRING_ RESIZE_ ERROR (4008) ERR_"Not initialized string" is MetaQuotes' whole description of this code.NOTINITIALIZED_ STRING (4009) ERR_"Invalid date and/or time" is MetaQuotes' whole description of this code.INVALID_ DATETIME (4010) ERR_"Total amount of elements in the array cannot exceed 2147483647" is MetaQuotes' whole description of this code.ARRAY_ BAD_ SIZE (4011) ERR_"Wrong pointer" is MetaQuotes' whole description of this code.INVALID_ POINTER (4012) ERR_"Wrong type of pointer" is MetaQuotes' whole description of this code.INVALID_ POINTER_ TYPE (4013) ERR_"Function is not allowed for call" is MetaQuotes' whole description of this code.FUNCTION_ NOT_ ALLOWED (4014) ERR_"The names of the dynamic and the static resource match" is MetaQuotes' whole description of this code.RESOURCE_ NAME_ DUPLICATED (4015) ERR_"Resource with this name has not been found in EX5" is MetaQuotes' whole description of this code.RESOURCE_ NOT_ FOUND (4016) 4017 ERR_"Unsupported resource type or its size exceeds 16 Mb" is MetaQuotes' whole description of this code.RESOURCE_ UNSUPPORTED_ TYPE 4018 ERR_"The resource name exceeds 63 characters" is MetaQuotes' whole description of this code.RESOURCE_ NAME_ IS_ TOO_ LONG ERR_"Overflow occurred when calculating math function" is MetaQuotes' whole description of this code.MATH_ OVERFLOW (4019) ERR_"Out of test end date after calling Sleep()" is MetaQuotes' whole description of this code.SLEEP_ ERROR (4020) ERR_The test was forcibly stopped from outside.PROGRAM_ STOPPED (4022) ERR_"Invalid type" is MetaQuotes' whole description of this code.INVALID_ TYPE (4023) ERR_"Invalid handle" is MetaQuotes' whole description of this code.INVALID_ HANDLE (4024) ERR_"Object pool filled out" is MetaQuotes' whole description of this code.TOO_ MANY_ OBJECTS (4025) ERR_"Wrong chart ID" is MetaQuotes' whole description of this code.CHART_ WRONG_ ID (4101) ERR_"Chart does not respond" is MetaQuotes' whole description of this code.CHART_ NO_ REPLY (4102) ERR_"Chart not found" is MetaQuotes' whole description of this code.CHART_ NOT_ FOUND (4103) ERR_"No Expert Advisor in the chart that could handle the event" is MetaQuotes' whole description of this code.CHART_ NO_ EXPERT (4104) ERR_"Chart opening error" is MetaQuotes' whole description of this code.CHART_ CANNOT_ OPEN (4105) ERR_"Failed to change chart symbol and period" is MetaQuotes' whole description of this code.CHART_ CANNOT_ CHANGE (4106) ERR_"Error value of the parameter for the function of working with charts" is MetaQuotes' whole description of this code.CHART_ WRONG_ PARAMETER (4107) 4108 ERR_"Failed to create timer" is MetaQuotes' whole description of this code.CHART_ CANNOT_ CREATE_ TIMER ERR_"Wrong chart property ID" is MetaQuotes' whole description of this code.CHART_ WRONG_ PROPERTY (4109) ERR_"Error creating screenshots" is MetaQuotes' whole description of this code.CHART_ SCREENSHOT_ FAILED (4110) ERR_"Error navigating through chart" is MetaQuotes' whole description of this code.CHART_ NAVIGATE_ FAILED (4111) ERR_"Error applying template" is MetaQuotes' whole description of this code.CHART_ TEMPLATE_ FAILED (4112) ERR_"Subwindow containing the indicator was not found" is MetaQuotes' whole description of this code.CHART_ WINDOW_ NOT_ FOUND (4113) 4114 ERR_"Error adding an indicator to chart" is MetaQuotes' whole description of this code.CHART_ INDICATOR_ CANNOT_ ADD 4115 ERR_"Error deleting an indicator from the chart" is MetaQuotes' whole description of this code.CHART_ INDICATOR_ CANNOT_ DEL 4116 ERR_"Indicator not found on the specified chart" is MetaQuotes' whole description of this code.CHART_ INDICATOR_ NOT_ FOUND ERR_"Error working with a graphical object" is MetaQuotes' whole description of this code.OBJECT_ ERROR (4201) ERR_"Graphical object was not found" is MetaQuotes' whole description of this code.OBJECT_ NOT_ FOUND (4202) ERR_"Wrong ID of a graphical object property" is MetaQuotes' whole description of this code.OBJECT_ WRONG_ PROPERTY (4203) ERR_"Unable to get date corresponding to the value" is MetaQuotes' whole description of this code.OBJECT_ GETDATE_ FAILED (4204) ERR_"Unable to get value corresponding to the date" is MetaQuotes' whole description of this code.OBJECT_ GETVALUE_ FAILED (4205) ERR_Fix recorded "Unknown symbol" is MetaQuotes' whole description of this code.MARKET_ UNKNOWN_ SYMBOL (4301) ERR_Fix recorded "Symbol is not selected in MarketWatch" is MetaQuotes' whole description of this code.MARKET_ NOT_ SELECTED (4302) ERR_"Wrong identifier of a symbol property" is MetaQuotes' whole description of this code.MARKET_ WRONG_ PROPERTY (4303) ERR_"Time of the last tick is not known (no ticks)" is MetaQuotes' whole description of this code.MARKET_ LASTTIME_ UNKNOWN (4304) ERR_"Error adding or deleting a symbol in MarketWatch" is MetaQuotes' whole description of this code.MARKET_ SELECT_ ERROR (4305) ERR_"Exceeded the limit of selected symbols in MarketWatch" is MetaQuotes' whole description of this code.MARKET_ SELECT_ LIMIT (4306) ERR_The session ID passed to SymbolInfoSessionQuote or SymbolInfoSessionTrade is wrong.MARKET_ SESSION_ INDEX (4307) ERR_"Requested history not found" is MetaQuotes' whole description of this code.HISTORY_ NOT_ FOUND (4401) ERR_"Wrong ID of the history property" is MetaQuotes' whole description of this code.HISTORY_ WRONG_ PROPERTY (4402) ERR_"Exceeded history request timeout" is MetaQuotes' whole description of this code.HISTORY_ TIMEOUT (4403) ERR_"Number of requested bars limited by terminal settings" is MetaQuotes' whole description of this code.HISTORY_ BARS_ LIMIT (4404) ERR_"Multiple errors when loading history" is MetaQuotes' whole description of this code.HISTORY_ LOAD_ ERRORS (4405) ERR_Fix recorded "Receiving array is too small to store all requested data" is MetaQuotes' whole description of this code.HISTORY_ SMALL_ BUFFER (4407) ERR_"Global variable of the client terminal is not found" is MetaQuotes' whole description of this code.GLOBALVARIABLE_ NOT_ FOUND (4501) ERR_"Global variable of the client terminal with the same name already exists" is MetaQuotes' whole description of this code.GLOBALVARIABLE_ EXISTS (4502) 4503 ERR_"Global variables were not modified" is MetaQuotes' whole description of this code.GLOBALVARIABLE_ NOT_ MODIFIED 4504 ERR_"Cannot read file with global variable values" is MetaQuotes' whole description of this code.GLOBALVARIABLE_ CANNOTREAD 4505 ERR_"Cannot write file with global variable values" is MetaQuotes' whole description of this code.GLOBALVARIABLE_ CANNOTWRITE ERR_"Email sending failed" is MetaQuotes' whole description of this code.MAIL_ SEND_ FAILED (4510) ERR_"Sound playing failed" is MetaQuotes' whole description of this code.PLAY_ SOUND_ FAILED (4511) ERR_"Wrong identifier of the program property" is MetaQuotes' whole description of this code.MQL5_ WRONG_ PROPERTY (4512) ERR_"Wrong identifier of the terminal property" is MetaQuotes' whole description of this code.TERMINAL_ WRONG_ PROPERTY (4513) ERR_"File sending via ftp failed" is MetaQuotes' whole description of this code.FTP_ SEND_ FAILED (4514) ERR_"Failed to send a notification" is MetaQuotes' whole description of this code.NOTIFICATION_ SEND_ FAILED (4515) 4516 ERR_Fix recorded The parameter for sending a notification is invalid: an empty string or NULL was passed to SendNotification().NOTIFICATION_ WRONG_ PARAMETER 4517 ERR_Fix recorded The notification settings in the terminal are wrong: the ID is not specified or permission is not set.NOTIFICATION_ WRONG_ SETTINGS 4518 ERR_"Too frequent sending of notifications" is MetaQuotes' whole description of this code.NOTIFICATION_ TOO_ FREQUENT ERR_"FTP server is not specified" is MetaQuotes' whole description of this code.FTP_ NOSERVER (4519) ERR_"FTP login is not specified" is MetaQuotes' whole description of this code.FTP_ NOLOGIN (4520) ERR_Fix recorded The file to send to the FTP server was not found in the Files directory under MQL5.FTP_ FILE_ ERROR (4521) ERR_"FTP connection failed" is MetaQuotes' whole description of this code.FTP_ CONNECT_ FAILED (4522) ERR_"FTP path not found on server" is MetaQuotes' whole description of this code.FTP_ CHANGEDIR (4523) ERR_"Not enough memory for the distribution of indicator buffers" is MetaQuotes' whole description of this code.BUFFERS_ NO_ MEMORY (4601) ERR_"Wrong indicator buffer index" is MetaQuotes' whole description of this code.BUFFERS_ WRONG_ INDEX (4602) ERR_"Wrong ID of the custom indicator property" is MetaQuotes' whole description of this code.CUSTOM_ WRONG_ PROPERTY (4603) ERR_"Wrong account property ID" is MetaQuotes' whole description of this code.ACCOUNT_ WRONG_ PROPERTY (4701) ERR_"Wrong trade property ID" is MetaQuotes' whole description of this code.TRADE_ WRONG_ PROPERTY (4751) ERR_Trading by Expert Advisors is prohibited.TRADE_ DISABLED (4752) ERR_"Position not found" is MetaQuotes' whole description of this code.TRADE_ POSITION_ NOT_ FOUND (4753) ERR_"Order not found" is MetaQuotes' whole description of this code.TRADE_ ORDER_ NOT_ FOUND (4754) ERR_"Deal not found" is MetaQuotes' whole description of this code.TRADE_ DEAL_ NOT_ FOUND (4755) ERR_"Trade request sending failed" is MetaQuotes' whole description of this code.TRADE_ SEND_ FAILED (4756) ERR_"Failed to calculate profit or margin" is MetaQuotes' whole description of this code.TRADE_ CALC_ FAILED (4758) ERR_"Unknown symbol" is MetaQuotes' whole description of this code.INDICATOR_ UNKNOWN_ SYMBOL (4801) ERR_"Indicator cannot be created" is MetaQuotes' whole description of this code.INDICATOR_ CANNOT_ CREATE (4802) ERR_"Not enough memory to add the indicator" is MetaQuotes' whole description of this code.INDICATOR_ NO_ MEMORY (4803) ERR_"The indicator cannot be applied to another indicator" is MetaQuotes' whole description of this code.INDICATOR_ CANNOT_ APPLY (4804) ERR_"Error applying an indicator to chart" is MetaQuotes' whole description of this code.INDICATOR_ CANNOT_ ADD (4805) ERR_"Requested data not found" is MetaQuotes' whole description of this code.INDICATOR_ DATA_ NOT_ FOUND (4806) ERR_"Wrong indicator handle" is MetaQuotes' whole description of this code.INDICATOR_ WRONG_ HANDLE (4807) 4808 ERR_"Wrong number of parameters when creating an indicator" is MetaQuotes' whole description of this code.INDICATOR_ WRONG_ PARAMETERS 4809 ERR_"No parameters when creating an indicator" is MetaQuotes' whole description of this code.INDICATOR_ PARAMETERS_ MISSING ERR_Fix recorded "The first parameter in the array must be the name of the custom indicator" is MetaQuotes' whole description of this code.INDICATOR_ CUSTOM_ NAME (4810) ERR_"Invalid parameter type in the array when creating an indicator" is MetaQuotes' whole description of this code.INDICATOR_ PARAMETER_ TYPE (4811) ERR_"Wrong index of the requested indicator buffer" is MetaQuotes' whole description of this code.INDICATOR_ WRONG_ INDEX (4812) ERR_"Depth Of Market can not be added" is MetaQuotes' whole description of this code.BOOKS_ CANNOT_ ADD (4901) ERR_"Depth Of Market can not be removed" is MetaQuotes' whole description of this code.BOOKS_ CANNOT_ DELETE (4902) ERR_"The data from Depth Of Market can not be obtained" is MetaQuotes' whole description of this code.BOOKS_ CANNOT_ GET (4903) ERR_"Error in subscribing to receive new data from Depth Of Market" is MetaQuotes' whole description of this code.BOOKS_ CANNOT_ SUBSCRIBE (4904) ERR_Fix recorded "More than 64 files cannot be opened at the same time" is MetaQuotes' whole description of this code.TOO_ MANY_ FILES (5001) ERR_"Invalid file name" is MetaQuotes' whole description of this code.WRONG_ FILENAME (5002) ERR_"Too long file name" is MetaQuotes' whole description of this code.TOO_ LONG_ FILENAME (5003) ERR_"File opening error" is MetaQuotes' whole description of this code.CANNOT_ OPEN_ FILE (5004) ERR_"Not enough memory for cache to read" is MetaQuotes' whole description of this code.FILE_ CACHEBUFFER_ ERROR (5005) ERR_"File deleting error" is MetaQuotes' whole description of this code.CANNOT_ DELETE_ FILE (5006) ERR_The file with this handle was closed, or was never opened.INVALID_ FILEHANDLE (5007) ERR_"Wrong file handle" is MetaQuotes' whole description of this code.WRONG_ FILEHANDLE (5008) ERR_Fix recorded "The file must be opened for writing" is MetaQuotes' whole description of this code.FILE_ NOTTOWRITE (5009) ERR_Fix recorded "The file must be opened for reading" is MetaQuotes' whole description of this code.FILE_ NOTTOREAD (5010) ERR_Fix recorded "The file must be opened as a binary one" is MetaQuotes' whole description of this code.FILE_ NOTBIN (5011) ERR_Fix recorded "The file must be opened as a text" is MetaQuotes' whole description of this code.FILE_ NOTTXT (5012) ERR_Fix recorded "The file must be opened as a text or CSV" is MetaQuotes' whole description of this code.FILE_ NOTTXTORCSV (5013) ERR_Fix recorded "The file must be opened as CSV" is MetaQuotes' whole description of this code.FILE_ NOTCSV (5014) ERR_"File reading error" is MetaQuotes' whole description of this code.FILE_ READERROR (5015) ERR_Fix recorded "String size must be specified, because the file is opened as binary" is MetaQuotes' whole description of this code.FILE_ BINSTRINGSIZE (5016) ERR_"A text file must be for string arrays, for other arrays - binary" is MetaQuotes' whole description of this code.INCOMPATIBLE_ FILE (5017) ERR_"This is not a file, this is a directory" is MetaQuotes' whole description of this code.FILE_ IS_ DIRECTORY (5018) ERR_"File does not exist" is MetaQuotes' whole description of this code.FILE_ NOT_ EXIST (5019) ERR_"File can not be rewritten" is MetaQuotes' whole description of this code.FILE_ CANNOT_ REWRITE (5020) ERR_"Wrong directory name" is MetaQuotes' whole description of this code.WRONG_ DIRECTORYNAME (5021) ERR_"Directory does not exist" is MetaQuotes' whole description of this code.DIRECTORY_ NOT_ EXIST (5022) ERR_"This is a file, not a directory" is MetaQuotes' whole description of this code.FILE_ ISNOT_ DIRECTORY (5023) ERR_"The directory cannot be removed" is MetaQuotes' whole description of this code.CANNOT_ DELETE_ DIRECTORY (5024) ERR_The directory could not be cleared.CANNOT_ CLEAN_ DIRECTORY (5025) ERR_"Failed to write a resource to a file" is MetaQuotes' whole description of this code.FILE_ WRITEERROR (5026) ERR_Fix recorded The end of a CSV file was reached, so the next piece of data could not be read.FILE_ ENDOFFILE (5027) ERR_"No date in the string" is MetaQuotes' whole description of this code.NO_ STRING_ DATE (5030) ERR_"Wrong date in the string" is MetaQuotes' whole description of this code.WRONG_ STRING_ DATE (5031) ERR_"Wrong time in the string" is MetaQuotes' whole description of this code.WRONG_ STRING_ TIME (5032) ERR_"Error converting string to date" is MetaQuotes' whole description of this code.STRING_ TIME_ ERROR (5033) ERR_"Not enough memory for the string" is MetaQuotes' whole description of this code.STRING_ OUT_ OF_ MEMORY (5034) ERR_"The string length is less than expected" is MetaQuotes' whole description of this code.STRING_ SMALL_ LEN (5035) ERR_"Too large number, more than ULONG_MAX" is MetaQuotes' whole description of this code.STRING_ TOO_ BIGNUMBER (5036) ERR_"Invalid format string" is MetaQuotes' whole description of this code.WRONG_ FORMATSTRING (5037) ERR_"Amount of format specifiers more than the parameters" is MetaQuotes' whole description of this code.TOO_ MANY_ FORMATTERS (5038) ERR_"Amount of parameters more than the format specifiers" is MetaQuotes' whole description of this code.TOO_ MANY_ PARAMETERS (5039) ERR_"Damaged parameter of string type" is MetaQuotes' whole description of this code.WRONG_ STRING_ PARAMETER (5040) ERR_"Position outside the string" is MetaQuotes' whole description of this code.STRINGPOS_ OUTOFRANGE (5041) ERR_"0 added to the string end, a useless operation" is MetaQuotes' whole description of this code.STRING_ ZEROADDED (5042) ERR_"Unknown data type when converting to a string" is MetaQuotes' whole description of this code.STRING_ UNKNOWNTYPE (5043) ERR_"Damaged string object" is MetaQuotes' whole description of this code.WRONG_ STRING_ OBJECT (5044) ERR_Fix recorded The arrays being copied are incompatible.INCOMPATIBLE_ ARRAYS (5050) ERR_"The receiving array is declared as AS_SERIES, and it is of insufficient size" is MetaQuotes' whole description of this code.SMALL_ ASSERIES_ ARRAY (5051) ERR_"Too small array, the starting position is outside the array" is MetaQuotes' whole description of this code.SMALL_ ARRAY (5052) ERR_"An array of zero length" is MetaQuotes' whole description of this code.ZEROSIZE_ ARRAY (5053) ERR_Fix recorded "Must be a numeric array" is MetaQuotes' whole description of this code.NUMBER_ ARRAYS_ ONLY (5054) ERR_Fix recorded "Must be a one-dimensional array" is MetaQuotes' whole description of this code.ONEDIM_ ARRAYS_ ONLY (5055) ERR_"Timeseries cannot be used" is MetaQuotes' whole description of this code.SERIES_ ARRAY (5056) ERR_Fix recorded "Must be an array of type double" is MetaQuotes' whole description of this code.DOUBLE_ ARRAY_ ONLY (5057) ERR_Fix recorded "Must be an array of type float" is MetaQuotes' whole description of this code.FLOAT_ ARRAY_ ONLY (5058) ERR_Fix recorded "Must be an array of type long" is MetaQuotes' whole description of this code.LONG_ ARRAY_ ONLY (5059) ERR_Fix recorded "Must be an array of type int" is MetaQuotes' whole description of this code.INT_ ARRAY_ ONLY (5060) ERR_Fix recorded "Must be an array of type short" is MetaQuotes' whole description of this code.SHORT_ ARRAY_ ONLY (5061) ERR_Fix recorded "Must be an array of type char" is MetaQuotes' whole description of this code.CHAR_ ARRAY_ ONLY (5062) ERR_"String array only" is MetaQuotes' whole description of this code.STRING_ ARRAY_ ONLY (5063) ERR_"OpenCL functions are not supported on this computer" is MetaQuotes' whole description of this code.OPENCL_ NOT_ SUPPORTED (5100) ERR_"Internal error occurred when running OpenCL" is MetaQuotes' whole description of this code.OPENCL_ INTERNAL (5101) ERR_"Invalid OpenCL handle" is MetaQuotes' whole description of this code.OPENCL_ INVALID_ HANDLE (5102) ERR_"Error creating the OpenCL context" is MetaQuotes' whole description of this code.OPENCL_ CONTEXT_ CREATE (5103) ERR_"Failed to create a run queue in OpenCL" is MetaQuotes' whole description of this code.OPENCL_ QUEUE_ CREATE (5104) ERR_"Error occurred when compiling an OpenCL program" is MetaQuotes' whole description of this code.OPENCL_ PROGRAM_ CREATE (5105) 5106 ERR_"Too long kernel name (OpenCL kernel)" is MetaQuotes' whole description of this code.OPENCL_ TOO_ LONG_ KERNEL_ NAME ERR_"Error creating an OpenCL kernel" is MetaQuotes' whole description of this code.OPENCL_ KERNEL_ CREATE (5107) 5108 ERR_"Error occurred when setting parameters for the OpenCL kernel" is MetaQuotes' whole description of this code.OPENCL_ SET_ KERNEL_ PARAMETER ERR_"OpenCL program runtime error" is MetaQuotes' whole description of this code.OPENCL_ EXECUTE (5109) ERR_"Invalid size of the OpenCL buffer" is MetaQuotes' whole description of this code.OPENCL_ WRONG_ BUFFER_ SIZE (5110) 5111 ERR_"Invalid offset in the OpenCL buffer" is MetaQuotes' whole description of this code.OPENCL_ WRONG_ BUFFER_ OFFSET ERR_"Failed to create an OpenCL buffer" is MetaQuotes' whole description of this code.OPENCL_ BUFFER_ CREATE (5112) ERR_"Too many OpenCL objects" is MetaQuotes' whole description of this code.OPENCL_ TOO_ MANY_ OBJECTS (5113) ERR_"OpenCL device selection error" is MetaQuotes' whole description of this code.OPENCL_ SELECTDEVICE (5114) ERR_"Internal database error" is MetaQuotes' whole description of this code.DATABASE_ INTERNAL (5120) ERR_"Invalid database handle" is MetaQuotes' whole description of this code.DATABASE_ INVALID_ HANDLE (5121) 5122 ERR_"Exceeded the maximum acceptable number of Database objects" is MetaQuotes' whole description of this code.DATABASE_ TOO_ MANY_ OBJECTS ERR_"Database connection error" is MetaQuotes' whole description of this code.DATABASE_ CONNECT (5123) ERR_"Request execution error" is MetaQuotes' whole description of this code.DATABASE_ EXECUTE (5124) ERR_"Request generation error" is MetaQuotes' whole description of this code.DATABASE_ PREPARE (5125) ERR_"No more data to read" is MetaQuotes' whole description of this code.DATABASE_ NO_ MORE_ DATA (5126) ERR_"Failed to move to the next request entry" is MetaQuotes' whole description of this code.DATABASE_ STEP (5127) ERR_"Data for reading request results are not ready yet" is MetaQuotes' whole description of this code.DATABASE_ NOT_ READY (5128) ERR_"Failed to auto substitute parameters to an SQL request" is MetaQuotes' whole description of this code.DATABASE_ BIND_ PARAMETERS (5129) 5200 ERR_"Invalid URL" is MetaQuotes' whole description of this code.WEBREQUEST_ INVALID_ ADDRESS 5201 ERR_"Failed to connect to specified URL" is MetaQuotes' whole description of this code.WEBREQUEST_ CONNECT_ FAILED ERR_"Timeout exceeded" is MetaQuotes' whole description of this code.WEBREQUEST_ TIMEOUT (5202) 5203 ERR_"HTTP request failed" is MetaQuotes' whole description of this code.WEBREQUEST_ REQUEST_ FAILED ERR_"Invalid socket handle passed to function" is MetaQuotes' whole description of this code.NETSOCKET_ INVALIDHANDLE (5270) 5271 ERR_"Too many open sockets (max 128)" is MetaQuotes' whole description of this code.NETSOCKET_ TOO_ MANY_ OPENED ERR_"Failed to connect to remote host" is MetaQuotes' whole description of this code.NETSOCKET_ CANNOT_ CONNECT (5272) ERR_"Failed to send/receive data from socket" is MetaQuotes' whole description of this code.NETSOCKET_ IO_ ERROR (5273) 5274 ERR_"Failed to establish secure connection (TLS Handshake)" is MetaQuotes' whole description of this code.NETSOCKET_ HANDSHAKE_ FAILED ERR_"No data on certificate protecting the connection" is MetaQuotes' whole description of this code.NETSOCKET_ NO_ CERTIFICATE (5275) ERR_"A custom symbol must be specified" is MetaQuotes' whole description of this code.NOT_ CUSTOM_ SYMBOL (5300) ERR_Fix recorded The name of the custom symbol is invalid.CUSTOM_ SYMBOL_ WRONG_ NAME (5301) ERR_Fix recorded The name of the custom symbol is too long.CUSTOM_ SYMBOL_ NAME_ LONG (5302) ERR_Fix recorded The path of the custom symbol is too long.CUSTOM_ SYMBOL_ PATH_ LONG (5303) ERR_"A custom symbol with the same name already exists" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ EXIST (5304) ERR_"Error occurred while creating, deleting or changing the custom symbol" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ ERROR (5305) ERR_Fix recorded "You are trying to delete a custom symbol selected in Market Watch" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ SELECTED (5306) 5307 ERR_"An invalid custom symbol property" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ PROPERTY_ WRONG 5308 ERR_"A wrong parameter while setting the property of a custom symbol" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ PARAMETER_ ERROR 5309 ERR_"A too long string parameter while setting the property of a custom symbol" is MetaQuotes' whole description of this code.CUSTOM_ SYMBOL_ PARAMETER_ LONG ERR_Fix recorded "Ticks in the array are not arranged in the order of time" is MetaQuotes' whole description of this code.CUSTOM_ TICKS_ WRONG_ ORDER (5310) ERR_"Array size is insufficient for receiving descriptions of all values" is MetaQuotes' whole description of this code.CALENDAR_ MORE_ DATA (5400) ERR_"Request time limit exceeded" is MetaQuotes' whole description of this code.CALENDAR_ TIMEOUT (5401) ERR_"Country is not found" is MetaQuotes' whole description of this code.CALENDAR_ NO_ DATA (5402) ERR_"Generic error" is MetaQuotes' whole description of this code.DATABASE_ ERROR (5601) ERR_"SQLite internal logic error" is MetaQuotes' whole description of this code.DATABASE_ LOGIC (5602) ERR_"Access denied" is MetaQuotes' whole description of this code.DATABASE_ PERM (5603) ERR_"Callback routine requested abort" is MetaQuotes' whole description of this code.DATABASE_ ABORT (5604) ERR_"Database file locked" is MetaQuotes' whole description of this code.DATABASE_ BUSY (5605) ERR_"Database table locked" is MetaQuotes' whole description of this code.DATABASE_ LOCKED (5606) ERR_"Insufficient memory for completing operation" is MetaQuotes' whole description of this code.DATABASE_ NOMEM (5607) ERR_"Attempt to write to readonly database" is MetaQuotes' whole description of this code.DATABASE_ READONLY (5608) ERR_"Operation terminated by sqlite3_interrupt()" is MetaQuotes' whole description of this code.DATABASE_ INTERRUPT (5609) ERR_"Disk I/O error" is MetaQuotes' whole description of this code.DATABASE_ IOERR (5610) ERR_"Database disk image corrupted" is MetaQuotes' whole description of this code.DATABASE_ CORRUPT (5611) ERR_"Unknown operation code in sqlite3_file_control()" is MetaQuotes' whole description of this code.DATABASE_ NOTFOUND (5612) ERR_"Insertion failed because database is full" is MetaQuotes' whole description of this code.DATABASE_ FULL (5613) ERR_"Unable to open the database file" is MetaQuotes' whole description of this code.DATABASE_ CANTOPEN (5614) ERR_"Database lock protocol error" is MetaQuotes' whole description of this code.DATABASE_ PROTOCOL (5615) ERR_"Internal use only" is MetaQuotes' whole description of this code.DATABASE_ EMPTY (5616) ERR_"Database schema changed" is MetaQuotes' whole description of this code.DATABASE_ SCHEMA (5617) ERR_"String or BLOB exceeds size limit" is MetaQuotes' whole description of this code.DATABASE_ TOOBIG (5618) ERR_"Abort due to constraint violation" is MetaQuotes' whole description of this code.DATABASE_ CONSTRAINT (5619) ERR_"Data type mismatch" is MetaQuotes' whole description of this code.DATABASE_ MISMATCH (5620) ERR_"Library used incorrectly" is MetaQuotes' whole description of this code.DATABASE_ MISUSE (5621) ERR_"Uses OS features not supported on host" is MetaQuotes' whole description of this code.DATABASE_ NOLFS (5622) ERR_"Authorization denied" is MetaQuotes' whole description of this code.DATABASE_ AUTH (5623) ERR_"Not used" is MetaQuotes' whole description of this code.DATABASE_ FORMAT (5624) ERR_"Bind parameter error, incorrect index" is MetaQuotes' whole description of this code.DATABASE_ RANGE (5625) ERR_"File opened that is not database file" is MetaQuotes' whole description of this code.DATABASE_ NOTADB (5626) ERR_"Internal error of the matrix/vector executing subsystem" is MetaQuotes' whole description of this code.MATRIX_ INTERNAL (5700) ERR_"Matrix/vector not initialized" is MetaQuotes' whole description of this code.MATRIX_ NOT_ INITIALIZED (5701) ERR_"Inconsistent size of matrices/vectors in operation" is MetaQuotes' whole description of this code.MATRIX_ INCONSISTENT (5702) ERR_"Invalid matrix/vector size" is MetaQuotes' whole description of this code.MATRIX_ INVALID_ SIZE (5703) ERR_"Invalid matrix/vector type" is MetaQuotes' whole description of this code.MATRIX_ INVALID_ TYPE (5704) ERR_"Function not available for this matrix/vector" is MetaQuotes' whole description of this code.MATRIX_ FUNC_ NOT_ ALLOWED (5705) ERR_"Matrix/vector contains non-numbers (Nan/Inf)" is MetaQuotes' whole description of this code.MATRIX_ CONTAINS_ NAN (5706) ERR_"Error during execution of an OpenBLAS function" is MetaQuotes' whole description of this code.MATRIX_ OPENBLAS (5707) 5708 ERR_"Invalid parameter of an OpenBLAS function" is MetaQuotes' whole description of this code.MATRIX_ OPENBLAS_ PARAMETER ERR_"ONNX internal error" is MetaQuotes' whole description of this code.ONNX_ INTERNAL (5800) ERR_"ONNX Runtime API initialization error" is MetaQuotes' whole description of this code.ONNX_ NOT_ INITIALIZED (5801) ERR_"Property or value not supported by MQL5" is MetaQuotes' whole description of this code.ONNX_ NOT_ SUPPORTED (5802) ERR_"ONNX runtime API run error" is MetaQuotes' whole description of this code.ONNX_ RUN_ FAILED (5803) 5804 ERR_"Invalid number of parameters passed to OnnxRun" is MetaQuotes' whole description of this code.ONNX_ INVALID_ PARAMETERS_ COUNT ERR_"Invalid parameter value" is MetaQuotes' whole description of this code.ONNX_ INVALID_ PARAMETER (5805) 5806 ERR_"Invalid parameter type" is MetaQuotes' whole description of this code.ONNX_ INVALID_ PARAMETER_ TYPE 5807 ERR_"Invalid parameter size" is MetaQuotes' whole description of this code.ONNX_ INVALID_ PARAMETER_ SIZE ERR_"Tensor dimension not set or invalid" is MetaQuotes' whole description of this code.ONNX_ WRONG_ DIMENSION (5808) ERR_Fix recorded This is not an error in itself: it is the first code available for errors that a program defines for itself.USER_ ERROR_ FIRST (65536)
Client library error codes
15 codes
Returned by the client library.
RES_Fix recorded The terminal did not respond in time.E_ INTERNAL_ FAIL_ TIMEOUT (- 10005) RES_Fix recorded IPC initialisation failed; the docs also list RES_E_INTERNAL_FAIL_CONNECT (internal IPC no ipc) under -10003.E_ INTERNAL_ FAIL_ INIT (- 10003) RES_No interprocess link (IPC) between the Python package and the terminal.E_ INTERNAL_ FAIL_ CONNECT (- 10003) RES_Fix recorded Receiving from the terminal failed.E_ INTERNAL_ FAIL_ RECEIVE (- 10002) RES_Fix recorded Sending to the terminal failed.E_ INTERNAL_ FAIL_ SEND (- 10001) RES_Fix recorded General failure talking to the terminal.E_ INTERNAL_ FAIL (- 10000) RES_Fix recorded Algo trading is disabled in the terminal.E_ AUTO_ TRADING_ DISABLED (- 8) RES_Fix recorded The method is not supported.E_ UNSUPPORTED (- 7) RES_Fix recorded Login to the trade account failed.E_ AUTH_ FAILED (- 6) RES_Fix recorded Version mismatch.E_ INVALID_ VERSION (- 5) RES_Fix recorded No history was found for the request.E_ NOT_ FOUND (- 4) RES_Fix recorded The terminal ran out of memory.E_ NO_ MEMORY (- 3) RES_Fix recorded The function was called with invalid arguments.E_ INVALID_ PARAMS (- 2) RES_Fix recorded A generic failure.E_ FAIL (- 1) RES_Fix recorded Generic success: the last call to the MetaTrader5 Python package worked.S_ OK (1)
Written up at length
How to cite this
MetaTrader 5 API error codes. Broker API Hub, https://openbrokerapi.com/errors/mt5, newest check .
Where you rely on a single figure, cite the source and the checked date printed beside it as well.