____Well, this function called "mainCheck()" is not executed at all. Just placing a function somewhere in the code does not mean that it will be executed. But something like this can help...
int init() {
if (mainCheck()==false) {IsTerminated(true); return(0);}
.....
or in start()
int start() {
if (mainCheck()==false) {return(0);}
.....
IsTerminated() is a custom function used inside the EA and this function plays the role of a variable. It is read with "IsTerminated();" (it is false by default) and set to true with "IsTerminated(true);". When set to true, the EA stops to react on ticks.[/quote:15t3p4n3][/quote:15t3p4n3]