Disabling an EA with wrong settings

 
I'm trying how to figure out how to completely disable an EA from trading unless it is using both the correct currency pair AND a 'licensing number' together at the same time and have them both be true or the EA will not function?
Then have it resume operation only when the settings are acceptable values.
 
extern int myValue = 10;

bool gbNoTrading = FALSE;
int init(){
   
  if (myValue < 1 || myValue > 100){
    gbNoTrading = TRUE;
  }
  return(0);
}

int start(){
  if (gbNoTrading == FALSE){
    return(0);
  }
  //....


  return(0);
}
hth Russell
 
Hi Russel,
I'm a NuB so I want to ask you about this to make sure that understand it correctly:
I change the 'MyValue' variable with my 'criteria'?
What about if I want to use both the correct currency pair AND a 'licensing number' together and have them both be true or the EA will not function?
I should of put these specific details into my original question, but it didn't really occur to me until I was examining your code.

Thanks for replying and your assistance.

 
Hi FourX,

sure you can add as many conditions as you want...
extern string gsSymbol = "EURUSD";
extern int giLicense = 12345;

bool gbNoTrading = FALSE;
int init(){
   
  if (gsSymbol != "GBPUSD" || giLicense != 563728){
    gbNoTrading = TRUE;
  }
  return(0);
}

int start(){
  if (gbNoTrading != FALSE){
    return(0);
  }
  //....


  return(0);
}

Russell
 
Thanks again Russell.
Its much appreciated. (< 8)