Download MetaTrader 5
To add comments, please log in or register
Publish your application in Cobe Base. Millions of traders will see it!
vaknineyal
57
vaknineyal 2014.06.08 07:47 

Hi guys,

I wrote expert and I want to limit it for 30 days limit and then it will not work.

or limit it until specific day.

Anyone know how can I do that ?

Thanks in advance.

 Eyal

whroeder1
13597
whroeder1 2014.06.08 09:54  
vaknineyal: I wrote expert and I want to limit it for 30 days limit and then it will not work. or limit it until specific day.
Ontick(){
   static datetime expiration=D'2014.03.05 15:46:58';
// or
   #define COMPILATION_DATE __DATE__
   #define EXPIRATION_DAYS 30
   static datetime expiration = COMPILATION_DATE + EXPIRATION_DAYS * PERIOD_D1 * 60;
//
   if( TimeCurrent() > expiration){ Alert("expired on "+expiration); ExpertRemove(); return; }
vaknineyal
57
vaknineyal 2014.06.08 09:58  
WHRoeder:
vaknineyal: I wrote expert and I want to limit it for 30 days limit and then it will not work. or limit it until specific day.


Thanks alot mate :) 

/
To add comments, please log in or register