Libraries: ErrorDescription

 

ErrorDescription:

The library contains functions that returns description of runtime error codes and trade server return codes.

Author: MetaQuotes Software Corp.

 
Automated-Trading posted  :

ErrorDescription:

Author: MetaQuotes Software Corp.

What about trade server return code 10027?


https://www.mql5.com/en/forum/458

 
Try to use this library with code 10027. We are going to update MQL5 Help.
 
Rosh:
Try to use this library with code 10027. We are going to update MQL5 Help.


Library does not compile on MT5 build 244


'ErrorDescription.mqh'    ErrorDescription.mqh    1    1
'TRADE_RETCODE_NO_CHANGES' - undeclared identifier    ErrorDescription.mqh    37    12
'TRADE_RETCODE_SERVER_DISABLES_AT' - undeclared identifier    ErrorDescription.mqh    38    12
'TRADE_RETCODE_CLIENT_DISABLES_AT' - undeclared identifier    ErrorDescription.mqh    39    12
'TRADE_RETCODE_LOCKED' - undeclared identifier    ErrorDescription.mqh    40    12
'TRADE_RETCODE_FROZEN' - undeclared identifier    ErrorDescription.mqh    41    12
no executable file produced        1    1
6 error(s), 0 warning(s)        1    1
 
investeo:


Library does not compile on MT5 build 244

Sorry, wait for update, please.
 

I would like to get recommendations on how the PBX should handle these messages.

TradeServerReturnCodeDescription(int return_code) 

I would like to get recommendations from the creators of the terminal, how the PBX should process them.

Let's say received response

case TRADE_RETCODE_REQUOTE: return(" Requote");

can immediately repeat the request or is some time delay recommended.

Let's say you have to pound the server until you get this message

case TRADE_RETCODE_TOO_MANY_REQUESTS: return(" Too frequent requests");

in turn what to do with it ? how the PBX should react to it, etc.

 
The championship is in 2 months, and in fact there is no function of opening the position... an error will come... and blame yourself... can put a pause of a few seconds on any error? what do you think?
 
Prival:

I'd like, in addition to the messages

I would like to receive recommendations from the creators of the terminal as to how the PBX should process them.

Let's say received response

case TRADE_RETCODE_REQUOTE: return (" Requote");

is it possible to repeat the request immediately or is some time delay recommended.


Structure of the trade query result

Field description

Field

Description

retcode

Trade serverreturn code

deal

Ticket of the deal, if it has been executed. Reported during a trade operation TRADE_ACTION_DEAL

order

Ticket of the order, if it is placed. It is reported during a trade operation TRADE_ACTION_PENDING

volume

Deal volume confirmed by the broker. Depends on the order execution type

price

The price in the deal confirmed by the broker. Depends on the deviationfield in the trade request and/or on the type of trade operation.

bid

Current market bid price (requote price)

ask

Current market bid price (requotes price)

comment

Broker's comment on the operation (filled by default)


Try to send a new trade request at the offered prices

 
ERR_CHART_WRONG_TIMER_PARAMETER code is not defined in Build 1100. It should be removed from this library as it gives a compilation error.
 

In errordescription.mqh line82 should be corrected

//      case ERR_CHART_WRONG_TIMER_PARAMETER:  return("Wrong parameter for timer");
      case ERR_CHART_WRONG_PARAMETER:        return("Wrong parameter for timer");

I commented it out, so it works.

 

It seems to me that in the errordescription.mqh file it makes sense to change the lines return("Unknown code of response to trade request") and return("Unknown error") to something more informative, for example, like this:

return("Unknown trade request response code: " + IntegerToString(return_code)) and

return("Unknown error: " + IntegerToString(err_code) );

The benefit is obvious. You will be able to catch erroneously passed error codes that are not codes and search for descriptions of codes that are not in the errordescription.mqh file in the same google. This is exactly how I have changed it.