Metatrader Error Codes
Contents |
Trade Server Return CodesCompiler WarningsCompilation Errors Runtime Errors Runtime Errors The GetLastError() function return last error code, stored in _LastError predefined variable. This value can be reset using
Mql4 Error 4109
the ResetLastError() function. Error code constants defined at stderror.mqh file. To mql4 error code 5004 print text messages use ErrorDescription() function defined at stdlib.mqh file. For convenience, trade errors are additionally listed mql4 error 4073 in the Trade Server Return Codes section. Runtime errors of mql4-program: Code ID Description 0 ERR_NO_ERROR No error returned 1 ERR_NO_RESULT No error returned, but the result is unknown
Mql4 Error 130
2 ERR_COMMON_ERROR Common error 3 ERR_INVALID_TRADE_PARAMETERS Invalid trade parameters 4 ERR_SERVER_BUSY Trade server is busy 5 ERR_OLD_VERSION Old version of the client terminal 6 ERR_NO_CONNECTION No connection with trade server 7 ERR_NOT_ENOUGH_RIGHTS Not enough rights 8 ERR_TOO_FREQUENT_REQUESTS Too frequent requests 9 ERR_MALFUNCTIONAL_TRADE Malfunctional trade operation 64 ERR_ACCOUNT_DISABLED Account disabled 65 ERR_INVALID_ACCOUNT Invalid account 128 ERR_TRADE_TIMEOUT Trade timeout 129
Mql4 Error 4051
ERR_INVALID_PRICE Invalid price 130 ERR_INVALID_STOPS Invalid stops 131 ERR_INVALID_TRADE_VOLUME Invalid trade volume 132 ERR_MARKET_CLOSED Market is closed 133 ERR_TRADE_DISABLED Trade is disabled 134 ERR_NOT_ENOUGH_MONEY Not enough money 135 ERR_PRICE_CHANGED Price changed 136 ERR_OFF_QUOTES Off quotes 137 ERR_BROKER_BUSY Broker is busy 138 ERR_REQUOTE Requote 139 ERR_ORDER_LOCKED Order is locked 140 ERR_LONG_POSITIONS_ONLY_ALLOWED Buy orders only allowed 141 ERR_TOO_MANY_REQUESTS Too many requests 145 ERR_TRADE_MODIFY_DENIED Modification denied because order is too close to market 146 ERR_TRADE_CONTEXT_BUSY Trade context is busy 147 ERR_TRADE_EXPIRATION_DENIED Expirations are denied by broker 148 ERR_TRADE_TOO_MANY_ORDERS The amount of open and pending orders has reached the limit set by the broker 149 ERR_TRADE_HEDGE_PROHIBITED An attempt to open an order opposite to the existing one when hedging is disabled 150 ERR_TRADE_PROHIBITED_BY_FIFO An attempt to close an order contravening the FIFO rule 4000 ERR_NO_MQLERROR No error returned 4001 ERR_WRONG_FUNCTION_POINTER Wrong function pointer 4002 ERR_ARRAY_INDEX_OUT_OF_RANGE Array index is out of range 4003 ERR_NO_MEMORY_FOR_CALL_STACK No memory for function call stack 4004 ERR_RECURSIVE_STACK_OVERFLOW Recursive stack overflow 4005 ERR_NOT_ENOUGH_STACK_FOR_PARAM Not enough stack for parameter 4006 ERR_NO_MEMORY_FOR_PARAM_STRING No memory
Return Codes Trade Server Return CodesCompiler WarningsCompilation ErrorsRuntime Errors Trade Server Return Codes GetLastError() - returns error codes. Error codes are defined in stderror.mqh. mql4 error 4108 To print the error description you can use the ErrorDescription() function,
Mql4 Error 5002
defined in stdlib.mqh. Example: #include
Page Last Post Printable Version Similar Threads Help With Understanding Error Code(s) in MT4 8 replies Help with EA - Code Error 7 replies Help with "OrderSend error 4051" 12 replies OrderModify - Error code 1 8 replies Help with http://www.forexfactory.com/showthread.php?p=5825157 error in code on a indicator 8 replies Platform Tech / Reply to Thread Subscribe 1 Attachments: Error code 4051 Exit Attachments Error code 4051 Post #1 Quote First Post: Jun 24, 2009 9:17pm Jun 24, 2009 9:17pm einstr | Joined May 2009 | Status: Member | 11 Posts hello, I have downloaded the divergence trader EA from the online MT4 library and have been optimizing it and testing it in a mql4 error demo acct for about three weeks. It appears to be working quite well but now each time I switch to the live account, I get an error: "order 0 failed to close. error: 4051" that occurs in an alert window. I get this alert about every 20 seconds. It actually caused other orders that I had open at the time to close immediately upon the alert. Could you please help me to metatrader error codes find out what the issue is? Thanks. Rich Post #2 Quote Jun 30, 2009 7:39pm Jun 30, 2009 7:39pm asgard2 | Joined Jun 2009 | Status: Member | 222 Posts I also get this message and depending which broker as to how often I get it. The error occurs in many ea's and right now alpari is my broker and so far they are the best. My trades also close all at once but not straight away, maybe 30 minutes later or not at all. Additionally if error is not picked up, the failed orders run from profit to debit and I get a margin call as orders open and dont close. Any help would be greatly appreciated. Post #3 Quote Jun 30, 2009 8:01pm Jun 30, 2009 8:01pm sergiu | Joined May 2006 | Status: Least Qualified Poster | 444 Posts It would be difficult to say much without seeing the code but error 4051 is an "invalid function parameter value" error. Stubbornly persistent Post #4 Quote Jun 30, 2009 8:34pm Jun 30, 2009 8:34pm asgard2 | Joined Jun 2009 | Status: Member | 222 Posts Well I am no programmer and I am new to this but I will try to find spot with the relevant code. Otherwise since mine is a commerci