2 symbols in mt5 only

 
#define ExpiredErr   "Please contact the seller, this version has expired. "
#define ExpiredErrr   "Wrong symbol "



int OnInit()
{


//--- Enable Trail
datetime expire_date = D'2024.04.01';
   if( TimeCurrent() >= expire_date )  {Comment(ExpiredErr);   Alert(ExpiredErr); return(INIT_FAILED);}  
   if( _Symbol != "EURUSD_raw")  {Comment(ExpiredErrr);    return(INIT_FAILED);}
   if( _Symbol != "GBPUSD_raw")  {Comment(ExpiredErrr);    return(INIT_FAILED);}
   

//---
   return(INIT_SUCCEEDED);

}
Please where am I doing wrong that it doesn't work?
 
Zbynek Liska:
Please where am I doing wrong that it doesn't work?
TimeCurrent is depending on a server connection. That might not be available in OnInit.

TimeLocal uses the computer clock, that should be available, but can be changed by the user...

Try doing this check in OnTick, then it should work.
 
Time works without symbols, it doesn't work with symbols at all