Errors, bugs, questions - page 1985

 
Alexey Kozitsyn:
Yes, of course.
Well, if yes and the value is set to 0, then of course something is wrong... You can see from the picture that each bar has an arrow with a value of 0.
 
Alexey Viktorov:
If it is and the value is 0, then there is certainly something wrong... You can see from the picture that each bar has an arrow with a value of 0.
The trick is that empty = EMPTY_VALUE.
 
Alexey Kozitsyn:
The trick is that empty = EMPTY_VALUE.
Empty is empty, but PLOT_EMPTY_VALUE is assigned a value that will not be shown in the graph and data window. Try changing EMPTY_VALUE to 0
PlotIndexSetDouble(plot_index, PLOT_EMPTY_VALUE, 0);
 

Forum on trading, automated trading systems and strategy testing

EA does not go to market. Error 130.

fxsaber, 2017.09.04 17:19

void OnStart()
{
  Print(0.99872);
}

Result

0.9987200000000001
(string)NormalizeDouble(0.99872, 5) - very long result.
 
Alexey Viktorov:
Empty is empty, but PLOT_EMPTY_VALUE is assigned a value that will not be shown in the chart and data window. Try changing EMPTY_VALUE to 0
No, there is still a crash. Now I have replaced EMPTY_VALUE with the EMPTY = EMPTY_VALUE constant. It is better now. But still there is rubbish on the chart when the TF is changed. I set EMPTY = 0. It is even better, but again, when the TF is frequently changed, the chart contains rubbish. In general, I have to write an application to the CD.
 
Alexey Kozitsyn:
No, there's still a bug. Now I've replaced EMPTY_VALUE by constant EMPTY = EMPTY_VALUE all over the code. It is better now. But still there is rubbish on the chart when the TF is changed. I set EMPTY = 0. It is even better, but again, when the TF is frequently changed, the chart contains rubbish. In general, I have to write an application to the CD.

What was that all about? I was talking about something else entirely. Well, in a pinch, instead of resetting the buffer.

ArrayInitialize(массив, 0);

you could set it to...

ArrayInitialize(массив, EMPTY_VALUE);
 
Alexey Viktorov:

What was that all about? I was talking about something else entirely. Well, in a pinch, instead of resetting the buffer.

you could put

It's about changing all initializations in the code at once. The code you wrote is initialized wherever you need it. ArrayInitialize() is run in OnDeinit(), but I have already described the result above.
 

Alexey Kozitsyn:
...

ArrayInitialize() runs in OnDeinit(), but I have already described the result above.

Try OnInit().
 
Anatoli Kazharski:
Try in OnInit().

There is initialisation in OnCalculate() at first run (prev_calculated == 0). Do you think moving it to OnInit() will change anything? Well, I'll try, of course, but this is something out of the realm of fantasy...

Cut. As I said, in OnDeinit() arrays are initialized, which are no longer used at next startup (changing input parameters). If this (initializing an array that isn't used as a buffer) helps - it would also be a MT bug. It'll turn out that not only are the arrays not used, but they (not marked up) can still be initialized and it will affect the display...

 
fxsaber:
(string)NormalizeDouble(0.99872, 5) is a very long result.

Afternoon!

Thank you for your message, we will check

Reason: