Download MetaTrader 5
To add comments, please log in or register
Speed up MQL5 Cloud Network. Install Strategy Tester Agent!
Sneck55
100
Sneck55 2014.06.05 14:16 

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?

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.06.05 15:13  
Make a prompt and ask whether need to change to false or not.
whroeder1
13624
whroeder1 2014.06.05 17:03  
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.
Sneck55
100
Sneck55 2014.06.05 18:28  
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?
Sneck55
100
Sneck55 2014.06.05 18:30  
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?
Sneck55
100
Sneck55 2014.06.05 18:31  
I have searched for both properties and prompt on MQL4 reference but neither is included.
Ian Venner
2583
Ian Venner 2014.06.05 21:04  
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.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.06.06 01:14  
 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.
Sneck55
100
Sneck55 2014.06.06 08:29  
Thank you for your help!
/
To add comments, please log in or register