As _LastError (like _Point) is not (any more) recognised by the debugger you have to declare a global variable and assign _LastError to it. This variable you can track in the debugger.
In MetaTrader 5, the _LastError system variable cannot be directly checked in the debugger because it is an internal system variable that updates after certain function calls.
The easiest way to track _LastError while debugging is to print its value right after the function calls. Sample code...
The easiest way to track _LastError while debugging is to print its value right after the function calls. Sample code...
int result = OrderSend(request); Print("OrderSend result: ", result, " | _LastError: ", _LastError);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In new versions of MetaTrader 5 it is impossible to check system variables from the debugger.
How to check _LastError variable while debugging? Or do you need to print it after each line of code?