I don't think that's right, because it might already be closed. And you will hang in the loop. And after these hangs, the terminal often has to be reinstalled.
just these two reasons or could there be something else?
An order can be closed partially, reopened with a different ticket, change type... for this you need to keep track of them - correctly. Through arrays.
I don't think this is right, because it might already be closed. And you'll be stuck in a loop. And after such hiccups the terminal often has to be reinstalled.
never happened - if it's closed, it won't go into a programme execution loop...
Roman.: The order can be closed partially, re-opened with a different ticket, change the type... For this you need to keep track of them - correctly. Through arrays.
I have a slightly different approach to accounting, although you can't do without arrays, that's true
However, let's get down to business...
If the order is not selected, what will the OrderType() or OrderTicket() be equal to, for example?
This construct was originally in someone's post with the question: How do I know the price of an order? the answer I used in this loop - see above.
Here is that answer to that question:
int ticket=OrderSend(Symbol(),OP_SELL,0.01,Bid,5,0,0,"OrderOpenOne",14774,0,CLR_NONE);
if (ticket>0) // Если позиция открылась
{
while(OrderSelect(ticket,SELECT_BY_TICKET)==false) // Если ордер выбран
{
Sleep(100);
}
double OpenPrice=OrderOpenPrice();
}
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.
BEFORE TALO. Until selected in the cycle:
I don't think that's right, because it might already be closed. And you will hang in the loop. And after these hangs, the terminal often has to be reinstalled.
it all makes sense
just these two reasons or could there be something else?I don't think this is right, because it might already be closed. And you'll be stuck in a loop. And after such hiccups the terminal often has to be reinstalled.
never happened - if it's closed, it won't go into a programme execution loop...
The order can be closed partially, re-opened with a different ticket, change the type... For this you need to keep track of them - correctly. Through arrays.
I have a slightly different approach to accounting, although you can't do without arrays, that's true
However, let's get down to business...
If the order is not selected, what will the OrderType() or OrderTicket() be equal to, for example?
However, to our rams...
if an order is not selected, what does OrderType() or OrderTicket() equal, for example? is this somehow provided for in MocL?
Oh, dear! It goes in the annals!
I have a slightly different approach to accounting, although you can't do without arrays, that's true
However, let's get down to business...
If an order is not selected, what does OrderType() or OrderTicket() equal, for example?
You're not looking for a catch where there is none. Put this code in your owl and enjoy your life.
I checked it myself - in online (not to mention in tester) everything works fine and without failures, even without arrays...
With arrays - also traded - everything works.
never happened - if it's closed, it won't enter the programme execution loop...
Roma, don't lie, the first time you wrote
Oh, my God! It's going in the annals!
This construct was originally in someone's post with the question: How do I know the price of an order? the answer I used in this loop - see above.
Here is that answer to that question:
Roma, don't lie, the first time you wrote
As I have done on all subsequent occasions. I'm as honest as I've ever been. :-)
This construction is used in the loop - see carefully - it's all there... the first, second and third time - everything is the same everywhere!