![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I know that
i like to correct this code
You should always check the result of the handle creation.
You MUST NOT return '0' in OnInit - in OnInit you must return:
ID
Description
INIT_SUCCEEDED
Initialization successful, EA test can be continued.
This code means the same as the zero value – the EA initialization in the tester is successful.
INIT_FAILED
Initialization failed. There is no point in continuing the test due to unavoidable errors. For example, it is impossible to create an indicator necessary for the EA operation.
The return of this value means the same as returning the value different from zero – EA initialization in the tester failed.
INIT_PARAMETERS_INCORRECT
Designed to denote an incorrect set of input parameters by a programmer. In the general optimization table, the result string with this return code is highlighted in red.
A test for such a set of EA inputs is not performed. The agent is ready to receive a new task.
When this value is received, the strategy tester does not pass this task to other agents for repeated execution.
INIT_AGENT_NOT_SUITABLE
No program execution errors during initialization. However, for some reasons, the agent is not suitable for conducting a test. For example, there is not enough RAM, no OpenCL support, etc.
After returning this code, the agent no longer receives tasks until the very end of this optimization.
Example:
You should always check the result of the handle creation.
You MUST NOT return '0' in OnInit - in OnInit you must return:
ID
Description
INIT_SUCCEEDED
Initialization successful, EA test can be continued.
This code means the same as the zero value – the EA initialization in the tester is successful.
INIT_FAILED
Initialization failed. There is no point in continuing the test due to unavoidable errors. For example, it is impossible to create an indicator necessary for the EA operation.
The return of this value means the same as returning the value different from zero – EA initialization in the tester failed.
INIT_PARAMETERS_INCORRECT
Designed to denote an incorrect set of input parameters by a programmer. In the general optimization table, the result string with this return code is highlighted in red.
A test for such a set of EA inputs is not performed. The agent is ready to receive a new task.
When this value is received, the strategy tester does not pass this task to other agents for repeated execution.
INIT_AGENT_NOT_SUITABLE
No program execution errors during initialization. However, for some reasons, the agent is not suitable for conducting a test. For example, there is not enough RAM, no OpenCL support, etc.
After returning this code, the agent no longer receives tasks until the very end of this optimization.
Example:
That not resolve the problem Sorry .
I will dig by myself