Debug problems in MetaEditor

 
I am debugging a  Trading System program on MT5 build 3683. I have a bool variable used  as input variable in a file that is included in main code file. If I compile and run the code within MT5, and then open the program panel showing input variables, the variable is listed with  the right value set (true). I f I run the code within the debugger of the Metaeditor and I stop the code  in the half by a breakpoint and check the value of this variable by adding it in the watchlist it show 'false'. Effectively at the beginning some days ago the variable was set to false but then I changed in the file and is 'true' as seen by the MT5 in the Program Panel for input variables. I recompile the program many times but nothing changed. I do the same with another input variable ( double type)  and it happens the same; the value seen in the debug watchlist is always the older one. It seems that the MetaEditor Debug store input variables data and do not refresh at each compilation (??). Anybody coud kindly explain me how to solve this issue?
Thanking in advance
 

This may have nothing to do with your issue, but please be aware that build 3683 is a beta build, which may have bugs. The latest official stable build is 3661.

If you don't want to be a beta tester, then don't connect to the MetaQuotes demo trade servers—connect only to reputable broker accounts, be they demo or real accounts.

 
Comments that do not relate to this topic, have been moved to "Off-topic posts".
 
Marco Capacci:
I am debugging a  Trading System program on MT5 build 3683. I have a bool variable used  as input variable in a file that is included in main code file. If I compile and run the code within MT5, and then open the program panel showing input variables, the variable is listed with  the right value set (true). I f I run the code within the debugger of the Metaeditor and I stop the code  in the half by a breakpoint and check the value of this variable by adding it in the watchlist it show 'false'. Effectively at the beginning some days ago the variable was set to false but then I changed in the file and is 'true' as seen by the MT5 in the Program Panel for input variables. I recompile the program many times but nothing changed. I do the same with another input variable ( double type)  and it happens the same; the value seen in the debug watchlist is always the older one. It seems that the MetaEditor Debug store input variables data and do not refresh at each compilation (??). Anybody coud kindly explain me how to solve this issue?
Thanking in advance
Please provide screenshots showing the values you are talking about.
 
Alain Verleyen #:
Please provide screenshots showing the values you are talking about.

Yes please see attached

.

 
Marco Capacci #:

Yes please see attached

.

Ok I see.

However I just checked my code with build 3683, I also have an mqh file with input variables. There is no such problem on my side.

So I can only recommend you to check all once again, are you sure the values set in the Input Window are not changed ? from a template for example.

The values hardcoded in the code doesn't matter, they are only the default values.

EDIT: You are using "real data" debugging right ? Not "history data".

 
Alain Verleyen #:

Ok I see.

However I just checked my code with build 3683, I also have an mqh file with input variables. There is no such problem on my side.

So I can only recommend you to check all once again, are you sure the values set in the Input Window are not changed ? from a template for example.

The values hardcoded in the code doesn't matter, they are only the default values.

EDIT: You are using "real data" debugging right ? Not "history data".

No template and input variables, as far as I know, may not changed by code statements: in any case there is no coding to change the input variables during program execution at all. I found the same issue on debug running a diferent  program (Autogenerated MT5 program on CCI indicator) just to be sure. Please find attached. I use historical data for debugging about 1 year typicallly
 
Marco Capacci #:
No template and input variables, as far as I know, may not changed by code statements: in any case there is no coding to change the input variables during program execution at all. I found the same issue on debug running a diferent  program (Autogenerated MT5 program on CCI indicator) just to be sure. Please find attached. I use historical data for debugging about 1 year typicallly

As I said you previously the values in the source code doesn't matter.

What matters is the runtime values. When using "history data" debugging, the inputs to take into account are the ones from the Strategy Tester.

And when you change the values in the code, you can reset the inputs to defaults.


 
Alain Verleyen #:

As I said you previously the values in the source code doesn't matter.

What matters is the runtime values. When using "history data" debugging, the inputs to take into account are the ones from the Strategy Tester.

And when you change the values in the code, you can reset the inputs to defaults.


Ok now I have understood. Thank you