Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please tell me why this script does not open deals and shows error 0, i.e. no error, but does not open deals.
Tell me how to decipher this, I don't understand how this piece works
So first we set the cnt variable to 0
Then, if the number of orders exceeds 0, OrderSelect is triggered.
But what is this same variable cnt with value 0 responsible for?
No nothing has become clear, why exactly 0? Are the orders numbered from zero or what?
And there is more.
OrderType()<=OP_SELLHow do I know if this is less than or equal to a sell order? Which one is smaller and which one is bigger?
No nothing has become clear, why exactly 0? Are the orders numbered from zero or what?
yep, from scratch. just like everything else.
And there is more.
How do I know if this is less than or equal to a sell order? How do we know which one is smaller and which one is bigger?
because OP_SELL is constant=1
So
OP_BUY - 0
OP_SELL - 1
OP_BUYLIMIT - 2
OP_BUYSTOP - 3
OP_SELLLIMIT - 4
OP_SELLSTOP - 5
that's how it works?
So
OP_BUY - 0
OP_SELL - 1
OP_BUYLIMIT - 2
OP_BUYSTOP - 3
OP_SELLLIMIT - 4
OP_SELLSTOP - 5
that's how it works?
Right. True, there is another value that equals 6.