Get last error

 
The error reported by GetLastError() How can I get the line where the error is?
 
damms005:
The error reported by GetLastError() How can I get the line where the error is?

Hi damms005, you don't have this information ready, anyway you can manage using ResetLastError() before a code or function you suspect, to isolate the error.

Documentation on MQL5: Common Functions / ResetLastError
Documentation on MQL5: Common Functions / ResetLastError
  • www.mql5.com
Common Functions / ResetLastError - Reference on algorithmic/automated trading language for MetaTrader 5
 
damms005:
The error reported by GetLastError() How can I get the line where the error is?

If you mean the error description, then please take a look at this link.

However, if you want to find where, inside your code, any error occurs, then it would be interesting to use a Print function together with some description and the GetLastError function. Something like:

Print("Error while sending the order. Error# = ",GetLastError());
 
Print("Function: "+__FUNCTION__+" line: "+(string)__LINE__+GetLastError());
Reason: