How to detect switch off/ on of autotrade button in mql4?

 
How can I detect switch off/ on of autotrade button in mql4?

The thing is that I don't know how I could restart some variables just when starting auotrade big button, like a reinitialisation.

This is for stop trading when a conditions are reached, and started again when I switch off and I switch on again.

Thank you so much
 
TerminalInfoInteger(TERMINAL_TRADE_ALLOWED);
 
IsStopped()
?
 

deysmacro:

IsStopped()
?

what the heck... ???
 
qjol:

So for example it is true when enabled and false when disabled or 1 / 0 ? Thank you so much
 
it's always: true = 1, false = 0;
Reason: