When should use POSITION_MAGIC, ORDER_MAGIC, DEAL_MAGIC ? - page 2

 

to solve the problem, I use HistoryOrderSelect and HistoryDealSelect instead of HistorySelect.

Documentation on MQL5: Trade Functions / HistoryOrderSelect
  • www.mql5.com
Trade Functions / HistoryOrderSelect - Documentation on MQL5