A problem was found in the historyselect() function

 

Usually we use it this way:

HistorySelect(0,TimeCurrent());

int  his_total  = HistoryDealsTotal();


but If the transaction frequency in a short time is greater than 1, some data will be lost due to the statistics of orders/deals

How to solve it?

use it in this way

HistorySelect(0,TimeCurrent()+1);


It took me two days to find out this problem.