What about trade server return code 10027?
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
Library does not compile on MT5 build 244
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.
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
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.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
ErrorDescription:
Author: MetaQuotes Software Corp.