Hi. This function is necessary, the expert Advisor increases the catch depending on the profit, but when a certain amount is reached, it resets the lot to the initial one and everything starts over again.
I did it like this:
if (profitclots < depo)
profitclots += (OrderProfit()+OrderCommission()+OrderSwap());
if (profitclots > depo)
prstop = (OrdersHistoryTotal()-1);
Counts, resets, but! When the order type changes, the profit becomes negative. If the orders are all of the same type, then all are good.
Tell me where to dig?