Need Help With Sample MQL5 File With Time Protection Lock

 
Tried some codes I got on this site but for some reason they don't run at all, would really appreciate it if someone could send me a sample to look like, I'm probably making a rookie mistake somewhere. Thanks

P.S: I'm a newbie at MQL5
 
int    CHECK_EXPIRY_TIME ()                                             { //< 1>
                                                                          //< 2>
static datetime EXPIRY_TIME = D'2020.04.30 00:00:00'                    ; //< 3>
                                                                          //< 4>
if   ( TimeCurrent  () > EXPIRY_TIME )                                    //< 5>
     {                                                                    //< 6>
       ExpertRemove ()                                                  ; //< 7>
       return NULL                                                      ; //< 8>
     }                                                                    //< 9>
                                                                          //<10>
return true                                                           ; } //<11>
 
aodunusi:
Tried some codes I got on this site but for some reason they don't run at all, would really appreciate it if someone could send me a sample to look like, I'm probably making a rookie mistake somewhere. Thanks

P.S: I'm a newbie at MQL5

If you want you can also use it on the OnInit() function, like that

int OnInit()
  {
//---
   datetime allowed_until = D'2020.4.30 00:00'; 
   datetime now = TimeCurrent();
   
   if (now > allowed_until)
   {
      return(INIT_FAILED); 
      Alert("Licence expired");
   }

//---
   return(INIT_SUCCEEDED);
  }