Errors, bugs, questions - page 3176

 
Andrei Sokolov function calls.

Yesterday I searched the whole evening for the bug, and this is the second time for this reason.

As a rule, all methods, which have OrderSelect, remember the selected ticket at the beginning, and select it again before exit. Otherwise it's hard to find such errors...

 
Andrey Khatimlianskii #:

A rule of thumb: in all methods that have OrderSelect

There are a lot of things you can take as a rule, and then try not to forget them, complicating your life with all this. I suggested how to make this life a little easier.

 
Andrei Sokolov #:

There are many things you can take as a rule and then try not to forget them, making life difficult for yourself. I suggested how to make life a little easier.

You should train yourself to write code accurately.

It is impossible to catch logical errors in program code at the compilation stage.

 
PapaYozh #:

impossible

In general, the logic of detecting such a situation is not complicated.

 
Andrei Sokolov #:

In general, the logic of detecting such a situation is not complicated.

It seems to you that it is not complicated, but "the devil is in the details".

Suppose you work with positions in OnTick and in OnTimer, too. Or you've screwed up the logic with classes.

 
PapaYozh #:

It seems to you that it is not complicated, but "the devil sits in the details".

Suppose you work with positions in OnTick and in OnTimer too. Or you've screwed up the logic with classes.

Try to get rid of it. I wrote about a specific situation, don't attribute something else to it.

 
Andrei Sokolov #:

Get a grip. I wrote about a specific situation, don't put something else in it.

There are a lot of "concrete" situations.

Just learn to program carefully.



P.S.

Andrei Sokolov #:

Get a life.

And refrain from the rudeness.

 
Andrei Sokolov #:

In general, the logic of detecting such a situation is not complicated.

So follow that logic :)
 
Andrei Sokolov #:

I suggested how to make this life a little easier.

Easier for who? Personally, this warning would annoy me. Is it this kind of concern for me? Or who? You've had three objections and you won't let it go.

And you're talking about mql4 too.
 
Alexey Viktorov #:

Personally, this warning would annoy me.

Do you use logic when after OrderSelect(), there is a nested OrderSelect() call?