MT5がEAを認識しない原因を教えてください。

2022/04/13 07:15
1957

mq5ファイルを、MQL5>Expertsに入れていますが、MT5ストラテジーテスターでEAを認識してくれません。考えらえれる原因を教えてください。

コメント

GogoJungle
2022/04/13 10:34

ex5ファイルが作成されていない可能性がございます。

ex5ファイルが作成されていない場合は、コンパイルに失敗している可能性がございますため
大変お手数ですが、コンパイル時に表示されるエラー内容を共有いただければ幸いでございます。

何卒よろしくお願い申し上げます。

相場職人TBO
2022/04/13 11:54

私も同じ状況ですのでこちらの回答を待ちたいと思います。

error.png

GogoJungle
2022/04/13 18:00

情報共有ありがとうございます。

添付画像のエラーにつきましては、Includeファイルが正常に読み込めない場合に発生するエラーかと存じます。
大変お手数ですが、下記記事を参考にIncludeファイルの設置場所につきまして、ご確認をお願い申し上げます。

Includeファイル(Tkool.mqh)の設置場所を教えてください。
https://labo.gogojungle.co.jp/articles/655

ご参考いただけますと幸いです。何卒よろしくお願い申し上げます。

はんと
2022/04/13 19:51

質問を投稿した時点では、.ex5は無かったのですが、12時間後の今、確認しましたら、いつの間にか.ex5がありました。
MT5でEAを認識できましたが、別途教えてください。
mq5を入れてから数分間は間違いなく.ex5はありませんでした。
.ex5が作られるまでに時間がかかるのでしょうか。

GogoJungle
2022/04/13 20:45

手動でコンパイルや下記ナビゲータで更新していない場合、
MT5を起動したタイミングで.ex5ファイルが生成されます。

ナビゲータ更新.png

ご参考いただけますと幸いです。何卒よろしくお願い申し上げます。

dth1200
2022/04/27 15:23

ex5ファイルが生成されず難儀しております。
Tkoolファイルにエラーが表示されておりましたが、これが原因でしょうか?

string ErrorDescription(int error_code)
{
   string error_string;

   if(error_code < 0) error_code = -1 * error_code;

   switch(error_code) {
      //Runtime Errors
      case 0:    error_string="The operation completed successfully"; break;
      case 4001: error_string="Unexpected internal error"; break;
      case 4002: error_string="Wrong parameter in the inner call of the client terminal function"; break;
      case 4003: error_string="Wrong parameter when calling the system function"; break;
      case 4004: error_string="Not enough memory to perform the system function"; break;
      case 4005: error_string="The structure contains objects of strings and/or dynamic arrays and/or structure of such objects and/or classes"; break;
      case 4006: error_string="Array of a wrong type, wrong size, or a damaged object of a dynamic array"; break;
      case 4007: error_string="Not enough memory for the relocation of an array, or an attempt to change the size of a static array"; break;
      case 4008: error_string="Not enough memory for the relocation of string"; break;
      case 4009: error_string="Not initialized string"; break;
      case 4010: error_string="Invalid date and/or time"; break;
      case 4011: error_string="Total amount of elements in the array cannot exceed 2147483647"; break;
      case 4012: error_string="Wrong pointer"; break;
      case 4013: error_string="Wrong type of pointer"; break;
      case 4014: error_string="Function is not allowed for call"; break;
      case 4015: error_string="The names of the dynamic and the static resource match"; break;
      case 4016: error_string="Resource with this name has not been found in EX5"; break;
      case 4017: error_string="Unsupported resource type or its size exceeds 16 Mb"; break;
      case 4018: error_string="The resource name exceeds 63 characters"; break;
      case 4019: error_string="Overflow occurred when calculating math function"; break;
      case 4020: error_string="Out of test end date after calling Sleep()"; break;
      case 4022: error_string="Test forcibly stopped from the outside. For example, optimization interrupted, visual testing window closed or testing agent stopped"; break;
      case 4101: error_string="Wrong chart ID"; break;
      case 4102: error_string="Chart does not respond"; break;
      case 4103: error_string="Chart not found"; break;
      case 4104: error_string="No Expert Advisor in the chart that could handle the event"; break;
      case 4105: error_string="Chart opening error"; break;
      case 4106: error_string="Failed to change chart symbol and period"; break;
      case 4107: error_string="Error value of the parameter for the function of working with charts"; break;
      case 4108: error_string="Failed to create timer"; break;
      case 4109: error_string="Wrong chart property ID"; break;
      case 4110: error_string="Error creating screenshots"; break;
      case 4111: error_string="Error navigating through chart"; break;
      case 4112: error_string="Error applying template"; break;
      case 4113: error_string="Subwindow containing the indicator was not found"; break;
      case 4114: error_string="Error adding an indicator to chart"; break;
      case 4115: error_string="Error deleting an indicator from the chart"; break;
      case 4116: error_string="Indicator not found on the specified chart"; break;
      case 4201: error_string="Error working with a graphical object"; break;
      case 4202: error_string="Graphical object was not found"; break;
      case 4203: error_string="Wrong ID of a graphical object property"; break;
      case 4204: error_string="Unable to get date corresponding to the value"; break;
      case 4205: error_string="Unable to get value corresponding to the date"; break;
      case 4301: error_string="Unknown symbol"; break;
      case 4302: error_string="Symbol is not selected in MarketWatch"; break;
      case 4303: error_string="Wrong identifier of a symbol property"; break;
      case 4304: error_string="Time of the last tick is not known (no ticks)"; break;
      case 4305: error_string="Error adding or deleting a symbol in MarketWatch"; break;
      case 4401: error_string="Requested history not found"; break;
      case 4402: error_string="Wrong ID of the history property"; break;
      case 4403: error_string="Exceeded history request timeout"; break;
      case 4404: error_string="Number of requested bars limited by terminal settings"; break;
      case 4405: error_string="Multiple errors when loading history"; break;
      case 4407: error_string="Receiving array is too small to store all requested data"; break;
      case 4501: error_string="Global variable of the client terminal is not found"; break;
      case 4502: error_string="Global variable of the client terminal with the same name already exists"; break;
      case 4503: error_string="Global variables were not modified"; break;
      case 4504: error_string="Cannot read file with global variable values"; break;
      case 4505: error_string="Cannot write file with global variable values"; break;
      case 4510: error_string="Email sending failed"; break;
      case 4511: error_string="Sound playing failed"; break;
      case 4512: error_string="Wrong identifier of the program property"; break;
      case 4513: error_string="Wrong identifier of the terminal property"; break;
      case 4514: error_string="File sending via ftp failed"; break;
      case 4515: error_string="Failed to send a notification"; break;
      case 4516: error_string="Invalid parameter for sending a notification – an empty string or NULL has been passed to the SendNotification() function"; break;
      case 4517: error_string="Wrong settings of notifications in the terminal (ID is not specified or permission is not set)"; break;
      case 4518: error_string="Too frequent sending of notifications"; break;
      case 4519: error_string="FTP server is not specified"; break;
      case 4520: error_string="FTP login is not specified"; break;
      case 4521: error_string="File not found in the MQL5 Files directory to send on FTP server"; break;
      case 4522: error_string="FTP connection failed"; break;
      case 4523: error_string="FTP path not found on server"; break;
      case 4524: error_string="FTP connection closed"; break;
      case 4601: error_string="Not enough memory for the distribution of indicator buffers"; break;
      case 4602: error_string="Wrong indicator buffer index"; break;
      case 4603: error_string="Wrong ID of the custom indicator property"; break;
      case 4701: error_string="Wrong account property ID"; break;
      case 4751: error_string="Wrong trade property ID"; break;
      case 4752: error_string="Trading by Expert Advisors prohibited"; break;
      case 4753: error_string="Position not found"; break;
      case 4754: error_string="Order not found"; break;
      case 4755: error_string="Deal not found"; break;
      case 4756: error_string="Trade request sending failed"; break;
      case 4758: error_string="Failed to calculate profit or margin"; break;
      case 4801: error_string="Unknown symbol"; break;
      case 4802: error_string="Indicator cannot be created"; break;
      case 4803: error_string="Not enough memory to add the indicator"; break;
      case 4804: error_string="The indicator cannot be applied to another indicator"; break;
      case 4805: error_string="Error applying an indicator to chart"; break;
      case 4806: error_string="Requested data not found"; break;
      case 4807: error_string="Wrong indicator handle"; break;
      case 4808: error_string="Wrong number of parameters when creating an indicator"; break;
      case 4809: error_string="No parameters when creating an indicator"; break;
      case 4810: error_string="The first parameter in the array must be the name of the custom indicator"; break;
      case 4811: error_string="Invalid parameter type in the array when creating an indicator"; break;
      case 4812: error_string="Wrong index of the requested indicator buffer"; break;
      case 4901: error_string="Depth Of Market can not be added"; break;
      case 4902: error_string="Depth Of Market can not be removed"; break;
      case 4903: error_string="The data from Depth Of Market can not be obtained"; break;
      case 4904: error_string="Error in subscribing to receive new data from Depth Of Market"; break;
      case 5001: error_string="More than 64 files cannot be opened at the same time"; break;
      case 5002: error_string="Invalid file name"; break;
      case 5003: error_string="Too long file name"; break;
      case 5004: error_string="File opening error"; break;
      case 5005: error_string="Not enough memory for cache to read"; break;
      case 5006: error_string="File deleting error"; break;
      case 5007: error_string="A file with this handle was closed, or was not opening at all"; break;
      case 5008: error_string="Wrong file handle"; break;
      case 5009: error_string="The file must be opened for writing"; break;
      case 5010: error_string="The file must be opened for reading"; break;
      case 5011: error_string="The file must be opened as a binary one"; break;
      case 5012: error_string="The file must be opened as a text"; break;
      case 5013: error_string="The file must be opened as a text or CSV"; break;
      case 5014: error_string="The file must be opened as CSV"; break;
      case 5015: error_string="File reading error"; break;
      case 5016: error_string="String size must be specified, because the file is opened as binary"; break;
      case 5017: error_string="A text file must be for string arrays, for other arrays - binary"; break;
      case 5018: error_string="This is not a file, this is a directory"; break;
      case 5019: error_string="File does not exist"; break;
      case 5020: error_string="File can not be rewritten"; break;
      case 5021: error_string="Wrong directory name"; break;
      case 5022: error_string="Directory does not exist"; break;
      case 5023: error_string="This is a file, not a directory"; break;
      case 5024: error_string="The directory cannot be removed"; break;
      case 5025: error_string="Failed to clear the directory (probably one or more files are blocked and removal operation failed)"; break;
      case 5026: error_string="Failed to write a resource to a file"; break;
      case 5027: error_string="Unable to read the next piece of data from a CSV file (FileReadString, FileReadNumber, FileReadDatetime, FileReadBool), since the end of file is reached"; break;
      case 5030: error_string="No date in the string"; break;
      case 5031: error_string="Wrong date in the string"; break;
      case 5032: error_string="Wrong 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="The string length is less than expected"; break;
      case 5036: error_string="Too large number, more than ULONG_MAX"; break;
      case 5037: error_string="Invalid format string"; break;
      case 5038: error_string="Amount of format specifiers more than the parameters"; break;
      case 5039: error_string="Amount of parameters more than the format specifiers"; break;
      case 5040: error_string="Damaged parameter of string type"; break;
      case 5041: error_string="Position outside the string"; break;
      case 5042: error_string="0 added to the string end, a useless operation"; break;
      case 5043: error_string="Unknown data type when converting to a string"; break;
      case 5044: error_string="Damaged string object"; break;
      case 5050: error_string="Copying incompatible arrays. String array can be copied only to a string array, and a numeric array - in numeric array only"; break;
      case 5051: error_string="The receiving array is declared as AS_SERIES, and it is of insufficient size"; break;
      case 5052: error_string="Too small array, the starting position is outside the array"; break;
      case 5053: error_string="An array of zero length"; break;
      case 5054: error_string="Must be a numeric array"; break;
      case 5055: error_string="Must be a one-dimensional array"; break;
      case 5056: error_string="Timeseries cannot be used"; break;
      case 5057: error_string="Must be an array of type double"; break;
      case 5058: error_string="Must be an array of type float"; break;
      case 5059: error_string="Must be an array of type long"; break;
      case 5060: error_string="Must be an array of type int"; break;
      case 5061: error_string="Must be an array of type short"; break;
      case 5062: error_string="Must be an array of type char"; break;
      case 5063: error_string="String array only"; break;
      case 5100: error_string="OpenCL functions are not supported on this computer"; break;
      case 5101: error_string="Internal error occurred when running OpenCL"; break;
      case 5102: error_string="Invalid OpenCL handle"; break;
      case 5103: error_string="Error creating the OpenCL context"; break;
      case 5104: error_string="Failed to create a run queue in OpenCL"; break;
      case 5105: error_string="Error occurred when compiling an OpenCL program"; break;
      case 5106: error_string="Too long kernel name (OpenCL kernel)"; break;
      case 5107: error_string="Error creating an OpenCL kernel"; break;
      case 5108: error_string="Error occurred when setting parameters for the OpenCL kernel"; break;
      case 5109: error_string="OpenCL program runtime error"; break;
      case 5110: error_string="Invalid size of the OpenCL buffer"; break;
      case 5111: error_string="Invalid offset in the OpenCL buffer"; break;
      case 5112: error_string="Failed to create an OpenCL buffer"; break;
      case 5113: error_string="Too many OpenCL objects"; break;
      case 5114: error_string="OpenCL device selection error"; break;
      case 5120: error_string="Internal database error"; break;
      case 5121: error_string="Invalid database handle"; break;
      case 5122: error_string="Exceeded the maximum acceptable number of Database objects"; break;
      case 5123: error_string="Database connection error"; break;
      case 5124: error_string="Request execution error"; break;
      case 5125: error_string="Request generation error"; break;
      case 5126: error_string="No more data to read"; break;
      case 5127: error_string="Failed to move to the next request entry"; break;
      case 5128: error_string="Data for reading request results are not ready yet"; break;
      case 5129: error_string="Failed to auto substitute parameters to an SQL request"; break;
      case 5200: error_string="Invalid URL"; break;
      case 5201: error_string="Failed to connect to specified URL"; break;
      case 5202: error_string="Timeout exceeded"; break;
      case 5203: error_string="HTTP request failed"; break;
      case 5270: error_string="Invalid socket handle passed to function"; break;
      case 5271: error_string="Too many open sockets (max 128)"; break;
      case 5272: error_string="Failed to connect to remote host"; break;
      case 5273: error_string="Failed to send/receive data from socket"; break;
      case 5274: error_string="Failed to establish secure connection (TLS Handshake)"; break;
      case 5275: error_string="No data on certificate protecting the connection"; break;
      case 5300: error_string="A custom symbol must be specified"; break;
      case 5301: error_string="The name of the custom symbol is invalid. The symbol name can only contain Latin letters without punctuation, spaces or special characters. It is not recommended to use characters."; break;
      case 5302: error_string="The name of the custom symbol is too long. The length of the symbol name must not exceed 32 characters including the ending 0 character"; break;
      case 5303: error_string="The path of the custom symbol is too long. The path length should not exceed 128 characters including Custom, the symbol name, group separators and the ending 0"; break;
      case 5304: error_string="A custom symbol with the same name already exists"; break;
      case 5305: error_string="Error occurred while creating, deleting or changing the custom symbol"; break;
      case 5306: error_string="You are trying to delete a custom symbol selected in Market Watch"; break;
      case 5307: error_string="An invalid custom symbol property"; break;
      case 5308: error_string="A wrong parameter while setting the property of a custom symbol"; break;
      case 5309: error_string="A too long string parameter while setting the property of a custom symbol"; break;
      case 5310: error_string="Ticks in the array are not arranged in the order of time"; break;
      case 5400: error_string="Array size is insufficient for receiving descriptions of all values"; break;
      case 5401: error_string="Request time limit exceeded"; break;
      case 5402: error_string="Country is not found"; break;
      case 5601: error_string="Generic error"; break;
      case 5602: error_string="SQLite internal logic error"; break;
      case 5603: error_string="Access denied"; break;
      case 5604: error_string="Callback routine requested abort"; break;
      case 5605: error_string="Database file locked"; break;
      case 5606: error_string="Database table locked"; break;
      case 5607: error_string="Insufficient memory for completing operation"; break;
      case 5608: error_string="Attempt to write to readonly database"; break;
      case 5609: error_string="Operation terminated by sqlite3_interrupt()"; break;
      case 5610: error_string="Disk I/O error"; break;
      case 5611: error_string="Database disk image corrupted"; break;
      case 5612: error_string="Unknown operation code in sqlite3_file_control()"; break;
      case 5613: error_string="Insertion failed because database is full"; break;
      case 5614: error_string="Unable to open the database file"; break;
      case 5615: error_string="Database lock protocol error"; break;
      case 5616: error_string="Internal use only"; break;
      case 5617: error_string="Database schema changed"; break;
      case 5618: error_string="String or BLOB exceeds size limit"; break;
      case 5619: error_string="Abort due to constraint violation"; break;
      case 5620: error_string="Data type mismatch"; break;
      case 5621: error_string="Library used incorrectly"; break;
      case 5622: error_string="Uses OS features not supported on host"; break;
      case 5623: error_string="Authorization denied"; break;
      case 5624: error_string="Not used"; break;
      case 5625: error_string="Bind parameter error, incorrect index"; break;
      case 5626: error_string="File opened that is not database file"; break;
      
      //Return Codes of the Trade Server
      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 completed"; break;
      case 10010: error_string="Only part of the request was completed"; break;
      case 10011: error_string="Request processing error"; break;
      case 10012: error_string="Request canceled by timeout"; break;
      case 10013: error_string="Invalid request"; break;
      case 10014: error_string="Invalid volume in the request"; break;
      case 10015: error_string="Invalid price in the request"; break;
      case 10016: error_string="Invalid stops in the request"; break;
      case 10017: error_string="Trade is disabled"; break;
      case 10018: error_string="Market is closed"; break;
      case 10019: error_string="There is not enough money to complete the request"; break;
      case 10020: error_string="Prices changed"; break;
      case 10021: error_string="There are no quotes to process the request"; break;
      case 10022: error_string="Invalid order expiration date in the request"; break;
      case 10023: error_string="Order state changed"; break;
      case 10024: error_string="Too frequent requests"; break;
      case 10025: error_string="No changes in request"; break;
      case 10026: error_string="Autotrading disabled by server"; break;
      case 10027: error_string="Autotrading disabled by client terminal"; break;
      case 10028: error_string="Request locked for processing"; break;
      case 10029: error_string="Order or position frozen"; break;
      case 10030: error_string="Invalid order filling type"; break;
      case 10031: error_string="No connection with the trade server"; break;
      case 10032: error_string="Operation is allowed only for live accounts"; break;
      case 10033: error_string="The number of pending orders has reached the limit"; break;
      case 10034: error_string="The volume of orders and positions for the symbol has reached the limit"; break;
      case 10035: error_string="Incorrect or prohibited order type"; break;
      case 10036: error_string="Position with the specified POSITION_IDENTIFIER has already been closed"; break;
      case 10038: error_string="A close volume exceeds the current position volume"; break;
      case 10039: error_string="A close order already exists for a specified position. This may happen when working in the hedging system"; break;
      case 10040: error_string="The number of open positions simultaneously present on an account can be limited by the server settings. After a limit is reached, the server returns the TRADE_RETCODE_LIMIT_POSITIONS error when attempting to place an order. The limitation operates differently depending on the position accounting type"; break;
      case 10041: error_string="The pending order activation request is rejected, the order is canceled"; break;
      case 10042: error_string="The request is rejected, because the Only long positions are allowed rule is set for the symbol"; break;
      case 10043: error_string="The request is rejected, because the Only short positions are allowed rule is set for the symbol"; break;
      case 10044: error_string="The request is rejected, because the Only position closing is allowed rule is set for the symbol"; break;
      case 10045: error_string="The request is rejected, because Position closing is allowed only by FIFO rule flag is set for the trading account"; break;
      case 10046: error_string="The request is rejected, because the Opposite positions on a single symbol are disabled rule is set for the trading account. For example, if the account has a Buy position, then a user cannot open a Sell position or place a pending sell order. The rule is only applied to accounts with hedging accounting system"; break;

      //User-Defined Errors
      case 65536:error_string=" User defined errors start with this code"; break;
      
      default:   error_string="unknown error";
   }
   return(error_string);
}

よろしくお願いいたします。

GogoJungle
2022/04/27 15:28

記載いただいた内容は、コンパイルエラーの内容ではなく、エラー処理に関連するプログラムでございますので、
大変お手数ですが、下記記事を参考にIncludeファイルの設置場所につきまして、ご確認をお願い申し上げます。

Includeファイル(Tkool.mqh)の設置場所を教えてください。
https://labo.gogojungle.co.jp/articles/655

ご参考いただけますと幸いです。何卒よろしくお願い申し上げます。

関連トピックス

検索結果がありません。

ノーコードで誰でも簡単EA開発!MQL言語学習にも使える! | GogoJungle

注目トピックス

検索結果がありません。