Errors, bugs, questions - page 895

 
Konstantin83: An order with a magik is opened. Then this magik is transferred to the trade and the position. Then when the position is closed at profit or stop the magic number is not transferred to the closing order.

How do I know the profit of a position by going through a magic trade? The closing trade does not go there because it does not have a magik.

POSITION_IDENTIFIER

Position ID is a unique number given to each newly opened position and does not change throughout its life. A rollover of the position does not change the position_identifier.

long

DEAL_POSITION_ID

Identifier of the position, in opening, modification or closing of which this deal was involved. Each position has a unique identifier, which is assigned to all deals made on the instrument during the life time of the position.

long

 
Abnormal termination means that the Expert Advisor is looped, does not check IsStopped and is forced to stop by the terminal.
 
Renat:
Abnormal termination means that the Expert Advisor is looped, it doesn't check IsStopped and is forced to stop by the terminal.

I can note that Abnormal termination is not only due to MQL code, but also due to internal hiccups of the runtime itself. So let's say Abnormal terminatio uncontrollable from MQL.

For example, when the MQL code sends a command to delete ObjectDelete an object from a chart that already exists (neither object nor chart). But it was there at the moment the command was sent.
And the MQL code will not wait for the response from the command, since the hang-up has occurred not in the MQL code, but in the depths of execution. That is, in ObjectDelete itself. as a result we will get an Abnormal termination
The second popular case is the operation of the ObjectsDeleteAll function. Since it is synchronous, it also hangs on deleting objects that have already been deleted, but only after it is called.
The third case is the most harmful, when the runtime cannot complete Expert Advisor command from Deinit, because the EA has been removed from the chart and the chart is closed. We will also get environment freeze and uncontrolled abnormal termination.

All I described above, everything relates specifically to termination of expander's work in OnDeinit function. Somewhere in the depths of code, there is inconsistency between ending actions, firstly with the presence of chart, and secondly - with behavior of environment at Deinit of expert.
Someone does something earlier and causes Abnormal termination.

Of course, in some cases I was able to solve this problem by additionally checking availability. But seldom, but one of the described synchronization problems occurs. The removal/installation of an indicator on a chart that is trying to close, the removal of objects.

 

I'd like some answers on how there can be an Absolute Drawdown MORE than Initial Balance.

Although by definition.

 Absolute Drawdown
Просадка от начального баланса показывает, насколько уменьшался баланс относительно первоначального значения. Максимально может быть равно начальному балансу, если потеряны все деньги.

Detailed in the topichttps://www.mql5.com/ru/forum/8996

 
Renat:
Abnormal termination means that the EA is looped and does not check IsStopped and is forcibly stopped by the terminal.

Wrong.

sergeev:

I might note that Abnormal termination is not only due to MQL code, but also due to internal hiccups in the runtime itself.

Yes, and there are a lot of such surprises.

I have experienced a hang of the terminal and the inability to delete the Expert Advisor due to insufficient memory. In this case, even the logging does not always get recorded.

 
komposter:

Wrong.

Yes, and there are plenty of surprises like that.

I have encountered terminal hangs and inability to delete EA if there is not enough memory. In this case even logging doesn't always work.

As I understood this threadhttps://www.mql5.com/ru/forum/8278 deals with this very issue.
Потребление памяти терминалом
Потребление памяти терминалом
  • www.mql5.com
Для чистоты эксперимента установил голый МТ5 в новую папку, открыл демо-счет на сервере MQ, закрыл все графики, установил "макс.
 
Yedelkin:

POSITION_IDENTIFIER

The position identifier is a unique number which is assigned to each newly opened position and does not change throughout its lifetime. A reversal of a position does not change the position_identifier.

long

DEAL_POSITION_ID

Identifier of the position, in opening, modification or closing of which this deal was involved. Each position has a unique identifier, which is assigned to all deals made on the instrument during the life time of the position.

long

Thank you, it helped)
 
iTC:
As I understood thishttps://www.mql5.com/ru/forum/8278 topic is related to this very issue.

No, it was about the indicators.

An Expert Advisor that exceeds some memory limit just silently hangs up the terminal. It happens, for example, when many charts of different symbols/periods with indicators are loaded.

 
sergeev:

I can note that Abnormal termination is not only due to MQL code, but also due to internal hiccups of the runtime itself. So let's say that the Abnormal terminatio is uncontrollable from MQL.

For example, when the MQL code sends a command to remove an ObjectDelete object from a chart that already exists (neither an object, nor a chart). But it was there at the time the command was sent.
And the MQL code will not wait for the response from the command, since the hang-up has occurred not in the MQL code, but in the depths of execution. That is, in ObjectDelete itself. as a result we will get an Abnormal termination
The second popular case is the operation of the ObjectsDeleteAll function. Since it is synchronous, it also hangs on deleting objects that have already been deleted, but only after it is called.
The third case is the most harmful, when the runtime cannot complete Expert Advisor command from Deinit, because the EA has been removed from the chart and the chart is closed. We will also get environment freeze and uncontrolled abnormal termination.

All I described above, everything relates specifically to termination of expander's work in OnDeinit function. Somewhere in the depths of code, there is inconsistency between ending actions, firstly with the presence of chart, and secondly - with behavior of environment at Deinit of expert.
Someone does something earlier and causes Abnormal termination.

Of course, in some cases I was able to solve this problem by additionally checking availability. But seldom, but one of the described synchronization problems occurs. The removal/installation of an indicator on a chart that is trying to close, the removal of objects.

Thank you, that will be checked.
 
komposter:

No, it was about the indicators.

An Expert Advisor that exceeds some memory limit just silently hangs up the terminal. This happens, for example, when many charts of different symbols/periods with indicators are loaded.

Thanks, we will definitely check it.