MQL5 HistoryDealGetTicket(index) error with code 4755

 
HistorySelect(0,TimeCurrent());
for(int i =0;i<HistoryDealsTotal();i++)
   {
      ulong ticket = HistoryDealGetTicket(i);
      Print(" i = " +i + " ticket = " + ticket+" total = "+HistoryDealsTotal());
      int err = GetLastError();
      Print(err);
   }

this is my EA's little code which doesn't works. I have no idea why that can't select Deals. On tester it works fine,but when i launch it on Demo Account occurs 4755 error.

 
Did you check the ticket value and did you reset last error?
 
Giorgi Gachechiladze: this is my EA's little code which doesn't works. I have no idea why that can't select Deals. On tester it works fine,but when i launch it on Demo Account occurs 4755 error.

I have same issue!

did you find any solution?

I reset error but nothing...

 
when i work with DealInfo.mqh not any issue! interesting. i will have a look to this include file.
 
Did anyone find the solution for it?
 
Error 4755 corresponds to ERR_TRADE_DEAL_NOT_FOUND , which means the specified deal was not found.

This error can occur if you try to access a deal that doesn't exist or isn't available in the history. For example, using the HistoryDealGetInteger() function without first selecting the deal with HistoryDealSelect() can trigger this error.

 It's important to make sure the deal is properly selected before attempting to access its properties.
 

Forum on trading, automated trading systems and testing trading strategies

MQL5 HistoryDealGetTicket(index) error with code 4755

Giorgi Gachechiladze, 2019.04.25 11:41

HistorySelect(0,TimeCurrent());
for(int i =0;i<HistoryDealsTotal();i++)
   {
      ResetLastError();
      ulong ticket = HistoryDealGetTicket(i);
      Print(" i = " +i + " ticket = " + ticket+" total = "+HistoryDealsTotal());
      int err = GetLastError();
      Print(err);
   }
This website uses cookies. Learn more about our Cookies Policy.