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

 
Aleksey Vyazmikin:
In general, profiling on historical data shows no errors.

In general, when limit=0 - print to log, in print - all components from which the variable limit is formed.

 
Alexey Kozitsyn:

In general, when limit=0 - print to log, in print - all the components from which the variable limit is formed.

Something's messing me up today.

code

         if (limit==0)
         {
         limit=2;
         Print("start_time - ",TimeToString(start_time,TIME_DATE|TIME_MINUTES)," stop_time - ",TimeToString(stop_time,TIME_DATE|TIME_MINUTES));
         Print("start_index=",start_index, " stop_index=",stop_index);
         }


in the printer.

FO      0       12:14:11.719    IndDrafter (BR Splice,M15)      start_time - 2018.07.04 10:00 stop_time - 2018.07.05 00:00
KL      0       12:14:12.072    IndDrafter (BR Splice,M15)      start_time - 2018.07.04 10:00 stop_time - 2018.07.05 00:00
QQ      0       12:14:12.072    IndDrafter (BR Splice,M15)      start_time - 2018.07.04 10:00 stop_time - 2018.07.05 00:00
GF      0       12:14:12.872    IndDrafter (BR Splice,M15)      start_time - 2018.07.04 10:00 stop_time - 2018.07.05 00:00

And where is the print withstart_index?

 
Aleksey Vyazmikin:

I'm having a bit of a glitch today.

code


in the printer.

Where's the print withstart_index?

Either it's in the logs, or the print isn't coming out of this part of the code at all.

 
Sergey Savinkin:

Either in the logs, or the prints aren't derived from that part of the code at all.

So I opened the log file and there's only one line. Prints from here - I wrote this myself, and if you comment on the first print, it doesn't print any more.

 
Aleksey Vyazmikin:

I'm having a bit of a glitch today.

code


in the printer.

Where's the print withstart_index?

 
Vladimir Karputov:

What does this have to do with optimization, the log from the terminal ...\MQL5\Logs

I erased the log for today - I'm waiting for the new data. Maybe that print really was with the wrong code.
 
Aleksey Vyazmikin:

I'm having a bit of a glitch today.

code


in the printer.

Where's the printer with thestart_index?

Then that leaves 2 versions:

1. Poltergeist, black magic, machinations of sorcerer enemies.

2. this is the wrong version of indicator. Maybe you are writing in a copy and there is a different indicator on the chart.

 
Aleksey Vyazmikin:

What does this have to do with optimization, the log from the terminal ...\MQL5\Logs

If my memory serves me right, the Terminal: Toolbox - Experts tab forcibly smothers the over-zealous ones who VERY often shoot prints to the journal.

 
Sergey Savinkin:

This leaves two versions:

1. Poltergeist, black magic, machinations of witchdoctors.

2. this is the wrong version of the indicator. Maybe you are writing in a copy, and there is another indicator on the chart.

The first option looks more likely, especially when you consider that it may be the cause of the second... :)

 

Total trash - got division by zero error again

2018.07.04 13:29:05.377 IndDrafter (Si-9.18,M15)        zero divide in 'IndDrafter.mq5' (479,56)

Code from ME as a picture - maybe I'm blind but I don't understand what's going on

The error is still on the same line.

double d1=(delta_price_high-center_line_point)/(limit/2);
The file is the same, as the error line has shifted due to the addition of code for the print.