Errors, bugs, questions - page 1395

 
Anatoli Kazharski:

Try it like this:

It doesn't matter what the empty value is there, or whether there are any random values left at the beginning of the graph. What is important is that there are values from 0 to -5 in buffer2 that are not displayed on the chart because it is DRAW_NONE and the minimum scale value of 0 is set.

MT4 in this situation correctly scaled the chart from 0 to the maximum buffer value in the window while MT5 scales from the minimum (-5, not 0) to the maximum like 0.0605 and adds something like 10% from above which completely breaks the scale.

 
Ilya Malev:

It doesn't matter what the empty value is or if there are random values left at the beginning of the graph. What is important is that there are values from 0 to -5 in buffer1 that are not displayed on the chart since it is DRAW_NONE and the minimum scale value of 0 is set.

MT4 in this situation correctly scaled the chart from 0 to the maximum buffer value in the window while MT5 scales from the minimum (-5, not 0) to the maximum like 0.0605 and adds something like 10% from above which breaks the scale completely.

Not at all. An empty value is not zero. It could be anything and anyone.
 
Ilya Malev:

It does not matter what the empty value is or whether there are any random values left at the beginning of the graph. What is important is that there are values from 0 to -5 in buffer2 that are not displayed on the chart as it is DRAW_NONE and the minimum scale value of 0 is set.

MT4 in this situation correctly scaled the chart from 0 to the maximum buffer value in the window while MT5 scales from the minimum (-5, not 0) to the maximum like 0.0605 and adds something like 10% from above which completely breaks the scale.

By the way, why scale the chart by buffer values that are not displayed?
 
Karputov Vladimir:
Not at all. An empty value is not zero. It could be anything and anyone.

Try changing the line to"buffer2[i]=-MathRand()%5*Point(); " And you'll see how the scale will change in the example. This proves that, in this case, filling the first elements in the history has no effect on scaling. Because if you multiply by Point, it aligns.

 
Anatoli Kazharski:
By the way, why should we scale the chart by values of the buffer that is not displayed?

Good question! That's exactly what I was asking. Why would MT do such scaling if the buffer is declared as DRAW_NONE

It was in MT4 too, but only if values of such buffer were within display range limited by indicator_maximum and minimim. And in MT5 the values outside the limits are included into the formula of scale.

 
Ilya Malev:

Try changing the line to"buffer2[i]=-MathRand()%5*Point();" and you will see how the scale will change in this example. This proves that, in this case, filling the first elements in the history has no effect on scaling. Because if you multiply by Point, it aligns.

Your example is crooked and you don't want to fix it. I will check it when you correct it.
 
Ilya Malev:
Good question! That's exactly what I was asking.

So it's in your code, isn't it?

buffer2[i]=-MathRand()%5;

What it says is what you get. What is the point of doing this for a buffer that is not displayed. That's what I was asking about. ))

 
Anatoli Kazharski:

What is written is what we get. What is the point of doing this for a buffer that is not displayed. That's what I was asking about. ))

Yeah, so when the terminal does it, it's OK (it scales by values with DRAW_NONE and is even lower than indicator_minimum display threshold - at least in MT4 it was adequate), but when a user sets his own arbitrary values in the buffer without display (DRAW_NONE), it is not OK (like keeping and not letting, who cares why the user needs it?).

The reason is trivial - these attributes display important numerical attributes of the bars in the chart, which the trader needs for analysis. That is, they are used by the trader and used by the Expert Advisors.

 
Ilya Malev:

Yeah, that is, when the terminal does it, it's OK (scale by values with DRAW_NONE, and even less than indicator_minimum threshold - at least it was adequate in MT4), but when user sets his arbitrary values into the buffer without display (DRAW_NONE), it is not OK (like keeping and not letting, who cares why the user needs it?)

The reason is trivial - these attributes display important numerical attributes of the bars in the data window, which the trader needs for analysis.

Well, I didn't say anything about normal or abnormal. I just wondered why to do so. )

I think that buffers that are not displayed (DRAW_NONE) should not be involved in the scale calculation.

You could try reporting this error to servicedesk and wait for a response there.

 
Anatoli Kazharski:

Well, I wasn't talking about normal or abnormal. I just wondered why you would do such a thing. )

I think buffers that are not displayed (DRAW_NONE) should not be involved in the scale calculation.

In the example I made MathRand just to demonstrate how the scale works. In the original I had the calculation of numerical levels there using some trader's author's methodology. At the beginning, we wanted to make them from 1 to 5, but even MT4 failed to achieve the adequate scale even with such values in the buffer with DRAW_NONE. After we made them negative and fixed the minimum at 0, the problem was solved. When porting the indicator to MT5 it appeared that this solution would not work either. I had to multiply by Point as Voldemar said.
Reason: