Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 204

 
solnce600:

What is illogical about my idea

Well, it makes sense, except it's not your idea.
 
tara:


Definitely with wrong logic. First, translate the highlighted fragment of your post into Russian.

After that, remove the sequences of conditional operators from your code. And then you'll get to the magician and life will get better.

I agree the allocated fragment is not quite clear even to me.I understand only that senior fellows mean that my mistake somehow

related to magic numbers of orders..... how exactly I have not yet understood.

Q. Is the incorrect logic connected with the magic numbers of the orders?

QUESTION: Remove conditional operator sequences from which part of the code? From starta, or from the body of custom function isCloseLastPosByStop

Q.If I remove them, what information will I get after that?

Thank you.

 
tara:
Well, it makes sense here, except it's not yours (the idea).

I'm not arguing with that.....-my idea in the sense that it also came into my head....and of course Mr. Martingale came up with it originally
 
solnce600:

I agree the highlighted fragment is not quite clear even to me.I understand only that senior comrades mean that my error somehow

is somehow connected with magic numbers of orders..... how exactly I have not yet understood.

Q. Is the incorrect logic connected with the magic numbers of the orders?

QUESTION Remove the conditional statement sequences from which part of the code? From starta, or from the body of the custom function isCloseLastPosByStop

QUESTION If I remove them - what information will I get after that.

Thank you.


Andrey, the term "logic" here means what is described in the code. I personally don't want to understand all the details of your code, but seeing the sequence if(A) if(B) if(C) D; I understand that you are not very good at logic algebra. By the way, the interpreter may well glitch from such constructions.
 
tara:


Definitely with faulty logic. For starters, translate the highlighted fragment of your post into Russian.

After that, remove the sequences of conditional operators from your code. And then you'll get to the magician and life will get better.

In this post you say that my logic is wrong, and in several posts below you agree with this logic....

 
solnce600:

In this post you say that my logic is wrong, and a few posts later you agree with that logic....




A good man once said: order frees the mind.

Your code is a mess, so your mind is not free.

 
tara:

Andrew, by "logic" here we mean what is described in the code. I personally don't want to go into details of all your code, but seeing the sequence if(A) if(B) if(C) D; I understand that you are not very good at logic algebra. By the way, the interpreter may well glitch from such constructions.

So, it's not good when there are so many if statements in a row?

if (ot==0)
if (Bid==Price)
//===============================================================
if(((Open[1]-Close[1])>100*Point)&&((Open[1]-Close[1])<120*Point))
if(((High[1]-Open[1])>40*Point)&&((High[1]-Open[1])<60*Point))

if(((Close[1]-Low[1])>40*Point)&&((Close[1]-Low[1])<60*Point))

or

for (i=k; i>=0; i--) {
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) {
if (OrderMagicNumber()!=mn) continue; // if the magician is wrong, go to the next
if (OrderSymbol()!=sy) continue; // if the symbol is wrong, proceed to the next
if (OrderType()!=op) continue; // if the type is wrong, proceed to the next
if (t<OrderCloseTime()) {
t=OrderCloseTime();
j=i;
}
}
}

 
tara:


A good man once said: order frees the mind.

Your code is a mess, which is why the mind is not free.

And what are the criteria of order as applied to code?
 

solnce600:

Of course, the first construction is flawed and can disrupt the interpreter.

Also - magik is an integer, not a double.

Also, a strict comparison of dubs is a rake.

... ... ...

Put things in order, don't be lazy to write comments, especially since you don't have experience yet.

Test the code by reading and executing it yourself, instead of the interpreter, at last.

 

OK. Thanks for the valuable advice.

Reason: