mt5 常用错误码函数
(2013-03-22 21:19:42)
标签:
模版财经 |
分类: MT5程序化交易 |
//return error description
string ErrorDesc(int error_code)
{
string error_string;
switch(error_code)
{
case 10004:error_string="Requote";break;
case 10006:error_string="Request rejected";break;
case 10007:error_string="Request canceled by trader";break;
case 10008:error_string="Order placed";break;
case 10009:error_string="Request executed";break;
case 10010:error_string="Request executed partially";break;
case 10011:error_string="Request processing error";break;
case 10012:error_string="Request time out";break;
case 10013:error_string="Invalid request";break;
case 10014:error_string="Invalid request volume";break;
case 10015:error_string="Invalid request price";break;
case 10016:error_string="Invalid Stop orders in the
request";break;
case 10017:error_string="Trading forbidden";break;
case 10018:error_string="Market is closed";break;
case 10019:error_string="Insufficient funds";break;
case 10020:error_string="Prices changed";break;
case 10021:error_string="No quotes to process the
request";break;
case 10022:error_string="Invalid order expiration in the
request";break;
case 10023:error_string="Order status changed";break;
case 10024:error_string="Too many requests";break;
case 10025:error_string="No changes in the request";break;
case 10026:error_string="Automated trading is disabled by
trader";break;
case 10027:error_string="Automated trading is disabled by the
client termimal";break;
case 10028:error_string="Request blocked for
processing";break;
case 10029:error_string="Order or position frozen";break;
case 10030:error_string="Specified type of order execution by
balance is not supported";break;
case 10031:error_string="No connection with trade
server";break;
case 10032:error_string="Transaction is allowed for live accounts
only";break;
case 10033:error_string="You have reached the maximum number of
pending orders";break;
case 10034:error_string="You have reached the maximum order and
position volume for this symbol";break;
//runtime errors
case 0://the operation performed successfully
case 4001:error_string="unexpected internal error";break;
case 4002:error_string="incorrect parameter in the internal call of
the client terminal function";break;
case 4003:error_string="incorrect parameter in the call of the
system function";break;
case 4004:error_string="not enough memory to perform the system
function";break;
case 4005:error_string="the structure contains string and/or
dynamic array objects and/or structures with such objects and/or
classes";break;
case 4006:error_string="invalid type or size of the array or
corrupted dynamic array object";break;
case 4007:error_string="not enough memory to reallocate the array
or an attempt to change the dynamic array size";break;
case 4008:error_string="not enough memory to reallocate the
string";break;
case 4009:error_string="uninitialized string";break;
case 4010:error_string="invalid time and/or date
value";break;
case 4011:error_string="requested array size exceeds 2
GB";break;
case 4012:error_string="incorrect reference";break;
case 4013:error_string="incorrect reference type";break;
case 4014:error_string="system function can not be
called";break;
string ErrorDesc(int error_code)
{