Errors, bugs, questions - page 348

 
Rosh:

If there is a position, you will get an infinite loop because

is equivalent to

There is no way to break out of the loop in the code because there is no break in the body of the operator;
Thank you very much, it shouldn't be there ; I corrected it, everything works
 

Mistakes (build 421, maybe something fixed in 425, no update to 425 from alpari yet):

1. Already wrote in the thread about 3D visualization: 3D chart captions (scale name and scale value) do not change when changing the parameters for displaying on the chart.

2. During fast optimization the graph is matched at about 10600th pass, i.e. optimization goes on for 50,51...60 generations and the graph does not shift and new passes are not displayed. At the same time, the Settings tab displays "Optimization progress:" instead of the number of passes, and under some unexplained circumstances it still changes to, for example, 12420/14400 (the figures are approximate).

3. Deleted agents can go to Busy state and remain in this state, I have to turn them off and on, after that the optimization continues.

And question: will it be possible to change graph view (1D/2D/3D) during optimization and not after its completion?

 
PiramidaR:

Mistakes (build 421, maybe something fixed in 425, no update to 425 from alpari yet):

In the same terminal, open an account from MetaQuotes and it will update. Then switch to another account again
 
PiramidaR:

Mistakes (build 421, maybe something fixed in 425, no update to 425 from alpari yet):

1. Already wrote in the thread about 3D visualization: 3D chart captions (scale name and scale value) do not change when changing the parameters for displaying on the chart.

2. During fast optimization the graph is matched at about 10600th pass, i.e. optimization goes on for 50,51...60 generations and the graph does not shift and new passes are not displayed. At the same time, the Settings tab displays "Optimization progress:" instead of the number of passes, and under some unexplained circumstances it still changes to, for example, 12420/14400 (the figures are approximate).

3. Deleted agents can go to Busy state and remain in this state, I have to turn them off and on, after that the optimization continues.

And a question: will it be possible to change graphics view (1D/2D/3D) during optimization and not after its completion?

1,2 Fixed, but not included in the latest build

3 We are working on it.

There will be no such feature

 
I would like to have a possibility not only to specify the value which will not be drawn
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE);

but also to be able to auto-initialisethe array with this value. If nothing has been assigned by the indicator to the last bar, then by default it assigns what has been specified in the

PLOT_EMPTY_VALUE

or rather, first you initialize it with an empty value and then let the indicator write whatever you want.

Because now the default value will be zero, but zero in many indicators is a significant number that should be drawn.

HZ wrote in this thread as I am not sure that this has not been solved, so the wish can be regarded as a question. If so, please tell me how it is solved.

 

Urain:

Because right now the default number will be zero, but zero in many indicators is a meaningful number to be drawn.

In fact, anything can be there, it's just that it's usually lucky that it's zero. The article tells directly about theindicator from the indicator in MQL5:

Is it necessary to initialize the indicator buffers?

Arrays in MQL5 are not initialized by default with any value, and this certainly applies to arrays that are assigned to indicator buffers using SetIndexBuffer(). If an array is an indicator buffer, its size will depend on the rates_total parameter in the OnCalculate() handler.

There may be a temptation to initialize all the indicator buffers with an empty value of EMPTY_VALUE using the ArrayInitialize() function, for example, once at the beginning of OnCalculate()
//--- если это первый вызов OnCalculate() 
   if(prev_calculated==0)
     {
      ArrayInitialize(TSIBuffer,EMPTY_VALUE);
     }

But it's not recommended to do it for the following reason: during the operation of the terminal, the quotes for the symbol, on the data of which the indicator is calculated, are received. Thus, the number of bars will increase over time, and the terminal will allocate additional memory for the indicator buffers.

But the values in the newly attached array elements will have any value, because when memory is reallocated for any array, there is no initialization. And the initial initialization can give a misleading confidence that all elements of the array, to which we haven't explicitly assigned any value, will be filled with the same value we initialized the array with the first time. This is certainly not true, and we should never rely on the value of some variable or array element being initialised with the value we want.

It's necessary to set a value for each element of the indicator buffer, and if the indicator value for this bar is not defined (not calculated, according to the algorithm implemented in the indicator), then for such cases an empty value should be explicitly set. For example, the indicator buffer value is calculated using the division operation, and at some point it may turn out that the divider is equal to zero.
 
Rosh:

Actually anything can be there, it's just that it's usually lucky that there's zero. The articleIndicator from Indicator in MQL5 explicitly says so:


This is exactly the problem I would like to solve at language level, because initialization of the last value will require additional lines of code where there may be errors.

This way you can be sure that there is the exact value and based on this you can build further algorithm.

 
Urain:

This is exactly the problem I would like to solve at language level, because initialization of the last value will require additional lines of code which may contain errors.

This way you can be sure that there is an exact value and on this basis you can build further algorithm.

I faced this problem too. I support: make a solution at language level.
 
Lizar:
I've encountered this too. I support: make the solution at the language level.
+1
 

Build 425

I'm confused by this situation with the tester: the EA is run several times under the same conditions, but the results of the runs are different. The difference is small, but...

Checked on two machines, I get 2 different results, with approximately equal probability. What would that mean?

Reason: