I'm testing on simple "return(x) or return(y)" for an EA, but with an error message "testFunction - function declarations are allowed namespace or class scope only", can someone advise me where am I go wrong ? Thanks
I learn to code by following https://www.mql5.com/en/forum/120791 ...
I learn to code by following https://www.mql5.com/en/forum/120791 ...
Inserted Code
input bool Exit_Only = 0;
int OnInit(){
return(INIT_SUCCEEDED);
}
void OnTick(){
int testFunction(){
if(Exit_Only==1)
return(1);
return(0);//else expecting 0
}
int resExitOnly=testFunction();
if(resExitOnly==1){
Comment("Exit Only");
Comment("both Entry & Exit");//else output
}
}