Both of them are a waste of time.
TheXpert:
Both of them are a waste of time.
Both of them are a waste of time.
Why?
valenok2003:
Why?
Why?
Because it's better this way:
int Total = OrdersTotal(); for (int i=Total; i>=1; i--) if(OrderSelect(i-1,SELECT_BY_POS,MODE_TRADES)==true) ...
valenok2003:
PATHY Why?
PATAMU that none of your options will close ALL orders if there are more than 1.
PATHY Why?
even one single order... may not close...
OrdersTotal() - Returns the total number of open and pending orders
For OrderSelect() - Does the numbering start with one or zero?
valenok2003:
OrdersTotal() - Returns the total number of open and pending orders
For OrderSelect() - does the numbering start with one or zero?
Think about what happens to the numbering after at least one order is closed.
The numbering starts from zero.
The first one is basically correct, it will close all the orders, but the closing prices should be normalized. The second fails, not all orders will close (the cycle is not correct)
Yep, got it, lots of holidays are bad for the brain. ))))
Thank you!
Techno:
The first one is basically correct, it will close all orders, but we have to normalize the closing prices. The second one fails, not all orders will be closed (the loop is not correct)
The first one is basically correct, it will close all orders, but we have to normalize the closing prices. The second one fails, not all orders will be closed (the loop is not correct)
It will not.
If you don't believe me, do an experiment on a demo.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Like this
or like this...
and will this function close all orders?
I have only one order closed for some reason, I can't figure out the reason.