加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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;
      //charts
      case 4101:error_string="incorrect chart identifier";break;
      case 4102:error_string="chart not responding";break;
      case 4103:error_string="chart not found";break;
      case 4104:error_string="no Expert Advisor on the chart to handle the event";break;
      case 4105:error_string="chart opening error";break;
      case 4106:error_string="Error when changing chart symbol and period";break;
      case 4107:error_string="incorrect timer value";break;
      case 4108:error_string="error when creating the timer";break;
      case 4109:error_string="incorrect chart property identifier";break;
      case 4110:error_string="error when creating the screenshor";break;
      case 4111:error_string="chart navigation error";break;
      case 4112:error_string="template application error";break;
      case 4113:error_string="subwindow with the specified indicator not found";break;
      case 4114:error_string="error when adding indicator to the chart";break;
      case 4115:error_string="error when removing indicator from the chart";break;
      case 4116:error_string="the indicator not found in the specified chart";break;
      //graphical objects
      case 4201:error_string="error when working with the graphical object";break;
      case 4202:error_string="the graphical object not found";break;
      case 4203:error_string="incorrect identifier of the graphical object property";break;
      case 4204:error_string="unable to get the date corresponding to the value";break;
      case 4205:error_string="unable to get the value corresponding to the date";break;
      //markertInfo
      case 4301:error_string="unknown symbol";break;
      case 4302:error_string="the symbol not selected in marketwatch";break;
      case 4303:error_string="incorrect symbol property identifier";break;
      case 4304:error_string="unknown time of the last tick (no ticks)";break;
      //access to history
      case 4401:error_string="requested history not found";break;
      case 4402:error_string="incorrect history property identifier";break;
      //global variables
      case 4501:error_string="global variable of the client terminal not found";break;
      case 4502:error_string="global variable of the client terminalwith this name already exists";break;
      case 4510:error_string="failed to send the message";break;
      case 4511:error_string="failed to play the sound";break;
      case 4512:error_string="incorrect program property identifier";break;
      case 4513:error_string="incorrect termimal property identifier";break;
      case 4514:error_string="failed to export the file by ftp";break;
      //buffers of custom indicators
      case 4601:error_string="not enough memory to allocate indicator buffers";break;
      case 4602:error_string="incorrect index of the custom indicator buffer";break;
      //custom indicator properites
      case 4603:error_string="incorrect custom indicator property identifier";break;
      //account
      case 4701:error_string="incorrect account property identifier";break;
      case 4751:error_string="incorrect trading property identifier";break;
      case 4752:error_string="the expert advisor is not allowed to trade";break;
      case 4753:error_string="the position not found";break;
      case 4754:error_string="the order not found";break;
      case 4755:error_string="the trade not found";break;
      case 4756:error_string="failed to send the trade request";break;
      //indicators
      case 4801:error_string="unknown symbol";break;
      case 4802:error_string="unable to create the indicator";break;
      case 4803:error_string="not enough memory to add the indicator";break;
      case 4804:error_string="unable to apply the indicator to another indicator";break;
      case 4805:error_string="error when adding the indicator";break;
      case 4806:error_string="requested data not found";break;
      case 4807:error_string="incorrect indicator handle";break;
      case 4808:error_string="invalid number of parameters when creating the indicator";break;
      case 4809:error_string="no parameters to create the indicator";break;
      case 4810:error_string="custom indicator name should be the first parameter in the array";break;
      case 4811:error_string="invalid parameter type in the array when creating the indicator";break;
      case 4812:error_string="incorrect index of the requested indicator buffer";break;
      //depth of market
      case 4901:error_string="unable to add the depth of market";break;
      case 4902:error_string="unable to delete the depth of market";break;
      case 4903:error_string="unable to get data from the depth of market";break;
      case 4904:error_string="error when subscribing to get new data from the depth of market";break;
      //file operations
      case 5001:error_string="the number of files open at the same time cannot exceed 64";break;
      case 5002:error_string="invalid file name";break;
      case 5003:error_string="file name too long";break;
      case 5004:error_string="file opening error";break;
      case 5005:error_string="not enough memory to cache read";break;
      case 5006:error_string="file deleting error";break;
      case 5007:error_string="the file with this handle has already been closed or has never been opened";break;
      case 5008:error_string="incorrect file handle";break;
      case 5009:error_string="the file must be open for writing";break;
      case 5010:error_string="the file must be open for reading";break;
      case 5011:error_string="the file must be open in binary mode";break;
      case 5012:error_string="the file must be open in text mode";break;
      case 5013:error_string="the file must be open in text mode or CSV format";break;
      case 5014:error_string="the file must be open in CSV format";break;
      case 5015:error_string="file reading error";break;
      case 5016:error_string="string size must be specified for the file that is open in binary mode";break;
      case 5017:error_string="there must be text file for string arrays and a binary file for all other arrays";break;
      case 5018:error_string="this is not a file , it is a directory";break;
      case 5019:error_string="the file does not exist";break;
      case 5020:error_string="the file cannot be rewritten";break;
      case 5021:error_string="incorrect directory name";break;
      case 5022:error_string="the directory does not exist";break;
      case 5023:error_string="this is not a directory, it is a file";break;
      case 5024:error_string="the directory cannot be deleted";break;
      case 5025:error_string="failed to clear the directory (can happen if one or more files is blocked and the deletion was not successful)";break;
      //string formatting
      case 5030:error_string="no date in the string";break;
      case 5031:error_string="incorrect date in the string";break;
      case 5032:error_string="incorrect time in the string";break;
      case 5033:error_string="error converting string to date";break;
      case 5034:error_string="not enough memory for the string";break;
      case 5035:error_string="string length is less than expected";break;
      case 5036:error_string="number too larger,bigger than ULONG_MAX";break;
      case 5037:error_string="incorrect format string";break;
      case 5038:error_string="the number of format specifiers is bigger than the number of parameters";break;
      case 5039:error_string="the number of parameters is bigger than the number of format specifiers";break;
      case 5040:error_string="corrupted string type parameter";break;
      case 5041:error_string="position outside of the string";break;
      case 5042:error_string="0 added to the end of the string ,content-free operation";break;
      case 5043:error_string="unknown data type when converting to string";break;
      case 5044:error_string="corrupted string object";break;
      //operations with arrays
      case 5050:error_string="cannot copy incompatible arrays. String array can only be copied to another string array and numeric array to another numeric array";break;
      case 5051:error_string="the receiving array is declared as AS_SERIES and its size is not sufficient";break;
      case 5052:error_string="array too small,the starting position is outside of the array";break;
      case 5053:error_string="zero length array";break;
      case 5054:error_string="the array must be numeric";break;
      case 5055:error_string="the array must be one-dimensional";break;
      case 5056:error_string="the time series can not be used";break;
      case 5057:error_string="the array must be of the double type";break;
      case 5058:error_string="the array must be of the float type";break;
      case 5059:error_string="the array must be of the long type";break;
      case 5060:error_string="the array must be of the int type";break;
      case 5061:error_string="the array must be of the short type";break;
      case 5062:error_string="the array must be of the char type";break;
      //user errors
     
      default:error_string="the error is undefined";break;
     }
   return(error_string);
}

0

阅读 收藏 喜欢 打印举报/Report
前一篇:番茄蛋汤
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有