Hi, I am new MQ4 developer. I have some question in my code. I need to find last close order from EA.
It can look by "OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);" or not?
I don't sure, If select by position on history order. This list will order by close time or not?
thank...
Next time, do some homework.
OrderCloseTime() is the function you need.
It will give the last order close time.
It can look by "OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);" or not?
I don't sure, If select by position on history order. This list will order by close time or not?
No, it is not guaranteed that the list will be in order of close time. You need to loop through all the orders, looking for the latest OrderCloseTime().
Use OrderSymbol(), OrderMagicNumber(), OrderType() and OrderCloseTime() to shieve.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I am new MQ4 developer. I have some question in my code. I need to find last close order from EA.
It can look by "OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);" or not?
I don't sure, If select by position on history order. This list will order by close time or not?
thank...