Errors, bugs, questions - page 1516

 
zaskok3:

Stop pretending you don't understand anything: the background can be dragged away from the flash drive. There are plenty of other ways. The main thing is to drag it out. You don't even have to do it on someone else's computer itself.

You have transferred your passwords, enabled password saving on someone else's computer and called it a hole. You've been hiding the fact that you enabled password saving until the very last moment.

The conclusion is logical - a dozen of your clones have already been released for recidivism.

 
Renat Fatkhullin:
Are there plans to make changes to the MetaEditor functionality to highlight variables, in the debugger to create automatically all the variables used? As in Qt Creator IDE or VS.
 
coderex:
Are there plans to make changes to the MetaEditor functionality to highlight variables, in the debugger to create automatically all the variables used? As in Qt Creator IDE or VS.
Yes, definitely.
 
Renat Fatkhullin:
Yes, I will.
I wonder how soon?
 
Slawa:
Please check application #1416121 on initialising global/static variables!
 
Alexey Kozitsyn:
Please check request #1416121 on initialization of global/static variables!

In the queue. The application is only two hours old.

Generally, such questions should be asked in a forum. Because it can affect a lot of people. I'll take the liberty of quoting you and then answering.

Hello. Correct me if I'm wrong. Static and global variables are initialized once before you start the program (i.e., the OnInit() function). Accordingly, if the program is deinitialized (OnDeinit() function is called), the program must "forget" values of global/static variables and before next run OnInit() initialize them with initial values.

I found an interesting fact in mql4 Expert Advisors. If you declare global/static variables, then, for example, when changing the input parameters, i.e. after OnDeinit(), these variables values are not reset. But in indicators - they are. What to do? This looks like an error.

I checked it on mql5 (build 1241 x64) - similar. In Expert Advisors - not reset, in indicators - reset.

This is a planned behavior. Moreover, it is clearly described in the documentation

Loading and Unloading of Indicators

Indicators are loaded in the following cases:

-attachingan indicator to a chart;

-startof the terminal (if an indicator was attached to a chart before the previous closing of the terminal)

-loadingof a template (if the template contains an indicator attached to the chart)

-changeprofile (if an indicator is attached to one of the profile charts);

-changethe symbol and/or period of the chart, to which the indicator is attached;

- after thesuccessful recompilation of an indicator, if this indicator has been attached to a chart

-change ofindicator input parameters.

Indicators are unloaded in the following cases:

- whendetaching an indicator from a chart;

-closingof the terminal (if an indicator is attached to a chart);

-loadingof a template, if an indicator is attached to a chart

Closethe chart to which an indicator has been attached; - Close the terminal (if an indicator has been attached to the chart)

-Changinga profile, if an indicator is attached to one of the charts of the profile to be changed;

-Changingthe symbol and/or period of the chart, to which the indicator is attached;

-changeindicator input parameters.

Unloading and loading involves complete re-initialisation of everything.

In Five, as you have correctly noted, the situation is similar.

It's true, it was historically so in MQL4 we first changed this behavior (to make it like in experts, i.e. the behavior you expect). But a lot of questions arose with the old indicators, that were based on this initialization. We were forced to return

In the five, this was the case immediately because of the architecture. When you change the parameters, the old indicator with the old parameters is destroyed and a new indicator with changed parameters is created.

Input переменные
Input переменные
  • docs.mql4.com
Input переменные
 
Slawa:
In the queue. The application is only two hours old.

I've duplicated it here just in case.

This is planned behaviour. Furthermore,it's clearly described in the documentation.

I just looked here and here. And I think it's logical, since I'm working with a static memory class. And, again, it makes sense that if there is a "catch" in the form of established techniques in relation to different types of programs, it would be good to describe it also in the documentation for the static memory class (static and global variables).

Please add to the remarks.

 
Alexey Kozitsyn:

I've duplicated it here, just in case.

It's just that I looked here and here. And I think it's logical, since I'm working with a static memory class. And, again, it makes sense that if there is a "catch" in the form of established techniques in relation to different types of programs, it would be good to describe it also in the documentation for the static memory class (static and global variables).

Please add to the remarks.

What comment? About program load/unload?
 
Slawa:
What comment? About program loading/unloading?
About the fact that initialization of static and global variables is caused by different events in indicators and Expert Advisors. Add, accordingly, in the paragraph about the global and static variables, in the "remarks" subsection.
 

MT5 help:

IsStopped
 
Проверяет принудительное завершение работы mql5-программы.
 
bool  IsStopped();
 
Возвращаемое значение
 
Возвращает true, если в системной переменной _StopFlag содержится значение, отличное от 0. Ненулевое значение записывается в переменную _StopFlag, если поступила команда завершить выполнение mql5-программы. 
В этом случае необходимо как можно быстрее завершить работу программы, в противном случае программа будет завершена принудительно извне через 3 секунды.

Just checked - the indicator is removed from the chart but continues to run for 3 seconds, 10 seconds, 3 minutes...(IsStopped was not checked there, this is not the question)

1) Why does it say "forced termination for 3 seconds" but in reality it doesn't work that way?

2) Why don't processes (scripts, indicators, Expert Advisors, tester agents) terminate forcibly when they are removed from a chart, a user stops a test, etc.?