A division by zero error appeared in one indicator - page 7

 
Aleksey Vyazmikin:

I might think about it, thanks. But the global problem is something else.... The trouble is that it's not stable.

Alternatively, the problem could be observed at the start of the hour bar. When the bar has just opened, there is only one minute value inside it.start_index would be equal tostop_index

 
Sergey Savinkin:

Alternatively, the problem could be observed at the beginning of an hourly bar. When the bar has just opened, there is only one minute value inside it.start_index would be equal tostop_index

No, it happens randomly, at different moments. The problem should not be related to the code, it worked correctly for a long time on different instruments and in different modes. I think it's some built-in function that broke after another update...

 

if(PeriodSeconds(_Period)!=0)limit=(int)(stop_time-start_time)/PeriodSeconds(_Period);

 
Renat Akhtyamov:

if(PeriodSeconds(_Period)!=0)limit=(int)(stop_time-start_time)/PeriodSeconds(_Period);

And when is this condition not expected to appear, in which case?

 
Aleksey Vyazmikin:

And when is this condition not expected to appear, in which case?

else

print time or write timestamp to global

will leave a trace, that's where you'll find out the problem
 

Has anyone managed to get a division error of zero at all? Print?

I just started 1 chart, waited an hour, no error, changed the profile to a working profile and the errors started. That's why I wondered if it's deeper than that.

 
Renat Akhtyamov:

else

print time or write time stamps to global

will leave a trace, that's where you'll find the problem.

The trace is already there, but what's the use of it - it is not reproduced in profiling or in the tester.

 
Aleksey Vyazmikin:

Has anyone managed to get a division error of zero at all? Print?

I just started 1 chart, waited an hour, no error, changed the profile to a working profile and the errors started. That's why I wondered if the matter lies even deeper?

Maybe I need to save the template from a working chart again?

is the wind not freezing, is the hard drive crumbling?

 
Renat Akhtyamov:

perhaps you need to save the template from the working chart again?

The windoesn't freeze, is the hard drive crumbling?

What's the use of saving the template? When I changed the profile there were dozens of different indicators being processed. At this point the terminal hangs, but then it comes back to normal.

I don't got a hang here, it's not a problem with the hard SSD. I suggested a problem with MT5 in terms of streaming indicator processing.

 

Suppose we have

2018.07.04 22:46:13.566 IndDrafter_Test (Si-9.18,M1)    i=638 start_time - 2018.04.28 23:38 stop_time - 2018.04.28 23:38
2018.07.04 22:46:13.566 IndDrafter_Test (Si-9.18,M1)    start_index=26430 stop_index=26430
2018.07.04 22:46:13.566 IndDrafter_Test (Si-9.18,M1)    TimeFrames=3600

We know thatstart_time should be2018.04.28 23:00

So the time is wrong here ?

datetime start_time=rates[i].time;
Reason: