Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1554

 
Vitaly Muzichenko #:

You have it all wrong, besides, an order can't be closed/open, it can be set/deleted.

A position can be closed.

I apologise for my MQL4 experience. Of course, we are talking about closed positions.

The function

HistoryDealsTotal

returns exactly the value of closed positions. But when debugging, I see that the required ticket is not passed to my function. (in the tester). And accordingly, the information about orders is incorrect. And the calculation of profit due to incorrectly passed Magic does not come at all.