Libraries: MT4Orders - page 11

 
hini #:

And the position history generated via CloseBy is different from the one I created manually.

It matches the timeline perfectly. Once again. MT5 generates the trading history. It is a crooked representation of closed positions.

You should not be guided by what MT5 shows, but by common sense.

 
fxsaber #:

It fits the timeline perfectly. Once again. MT5 generates a trading history. It is a crooked representation of closed positions.

You should not be guided by what MT5 shows, but by common sense.

Okay, I get it. You are focusing on the process of closing historical orders.

And I wanted to say, or more precisely, get a list of positions (orders for positions) that existed in the account between the two specified points in time.

Of course, because of the CloseBy operation, the price and closing time of some orders may be inaccurate. But for me (as a user) it is not critical, as the profit calculation is correct. If you need details, you can always look in the "Orders & Deals" section.
 
hini #:
a list of positions (position orders) that existed in the account between the two specified points in time.
This shows MT4Orders in the mode without snapshots. I.e. at once.
 
#define  MT4ORDERS_BYPASS_MAXTIME 1000000

When this macro is enabled, for some reason sometimes a line with two or three tickets is printed to the log: "18521123 22323214".

After commenting out this macro, this has never happened again. I tried to find Print in the code, but I couldn't find it.

 
hini Print in the code, but I couldn't find it.
Include\fxsaber\TradesID\ByPass.mqh

Some time ago MQ messed up the formation of the table of historical orders and did not want to fix it. Therefore, this macro does not guarantee its functionality, which it had before the bad implementation of MQ.
 
fxsaber #:

Some time ago MQ messed up the formation of the table of historical orders and did not want to fix it. Therefore, this macro does not guarantee its functionality, which it had before the bad implementation of MQ.
What are you talking about ?
 
fxsaber # :
So this macro does not guarantee its functionality that it had before the bad implementation of MQ.
So we have to abandon this macro?
 
Alain Verleyen #:
What are you talking about?
Here is a very detailed reproduction. Briefly - a newly deleted pending order may not get to the end of the trading history, because it is forcibly sorted by tickets.
Зашивается в Ex5 или задается терминалом при загрузке платформы MetaTrader 5 build 2940
Зашивается в Ex5 или задается терминалом при загрузке платформы MetaTrader 5 build 2940
  • 2021.06.19
  • www.mql5.com
Это как с транзакциями в OnTradeTransaction - очередность прихода транзакций не гарантируется. Одни транзакции фактически приходят после других хотя в теории должно быть наоборот. Супер-оптимизированная разработчиками HistorySelect дозаписывает в конец все новые ордера
 
hini #:
So we have to abandon this macro?

The macro used this feature.

Forum on Trading, Automated Trading Systems and Testing Trading Strategies

New version of MetaTrader 5 build 2940: MQL5 services showcases moved to the workspace and design update

fxsaber, 2021.06.11 09:47 PM

If you use HistorySelect from zero, new orders go to the end of the table while the Expert Advisor is running - correctly.

  • If you work ONLY with HistorySelect(0, INT_MAX), new orders (that get into the history during the EA work) will be added to the end - sorting by ORDER_TIME_DONE_MSC.

This was broken. So the macro cannot guarantee its functionality.


ZY In Virtual, when deleting a pending order, it is always written to the end of the historical table of orders. MT5-tester does the same. The problem is only in Terminal.