Code to assign a new value to an external variable without opening the properties window

 

I have defined an external variable as follows:

extern bool Level = false;

During program execution I need to change "Level" from false to true so I open the properties window and change it. No problem.

Then I go away and leave the program running and whilst I am away certain things happen which make "Level=true" incorrect. "Level" must be changed back to it's original "Level=false" setting, except I am not there to open the properties window and change it. How can I change "Level" back to "false" automatically in the code please?

 
Make a prompt and ask whether need to change to false or not.
 
Sneck55: except I am not there to open the properties window and change it.
The EA must return from start and be waiting for a new tick, then you can open properties.
 
WHRoeder:
Sneck55: except I am not there to open the properties window and change it.
The EA must return from start and be waiting for a new tick, then you can open properties.


deysmacro:
Make a prompt and ask whether need to change to false or not.

ok how do I make a prompt please?
 
WHRoeder:
Sneck55: except I am not there to open the properties window and change it.
The EA must return from start and be waiting for a new tick, then you can open properties.
how do I open properties in the code please?
 
I have searched for both properties and prompt on MQL4 reference but neither is included.
 
Sneck55:

How can I change "Level" back to "false" automatically in the code please?

 

if( //condition when to change Level to false )
{Level=false;
}

This change wont be reflected in the properties tab. The next time you open it, it will still say true, even though the actual value of the var is changed back to false in the code. I dont think there is a way to make that change be reflected in the properties tab except when you do it manually.

That has always been a minor annoyance of mql4. I think if you want inputs that can be modified by both the user and the code while staying updated to their current status, you should create a clickable button or something of that nature.

 
 I think if you want inputs that can be modified by both the user and the code while staying updated to their current status, 
you should create a clickable button or something of that nature.
Best solution. Nuff said.
 
Thank you for your help!