HistorySelect works not properly


i still have problems to get HistorySelect properly.

Basically, HistorySelect does not return orders latest place. They can be seen in the history tab but are not reflected through History order list.

Simply open a position with BUY or SELL manually, raise, lower Position with BUY or SELL (market).

You will see: sooner or later latest orders are not printed to expert log but can be seen in history tab.

Documentation on MQL5: Trade Functions / HistorySelect

You can use TimeTradeServer() instead of TimeCurrent().

void scan_orders(void)
   datetime to=TimeTradeServer();

try it yourself to get what you need.


already done. Not save as well. Latest orders somtimes missed.

What i need is very simple: if there is a history order, i’d like to query it with HistorySelect with 100% success, not 70 %.

If you don’t believe, please checkout my code. If you have a definite solution, i appreciate. Thank you.

You should write to Servicedesk with all details if you are sure.

Thank you for this hint.