A day counter needed

 

I need a counter to count 30 days and at the end of 30 days send an alert saying "30 days is counted".

Please if you know the solution let me know. TIA

 
Could someone please help me with a function to calculate a code for 30 days and after 30 days send an alert saying "30 days is counted" TIA
 
forexaccount:
Could someone please help me with a function to calculate a code for 30 days and after 30 days send an alert saying "30 days is counted" TIA
Look at PM.
 
01005379:
Look at PM.


Please try to avoid using PMs to deliver help. This is a public forum and the intention is to help ALL new users of the MQL programming language.

CB

 
datetime alert.when;
init() { alert.when = TimeCurrent() + 30 * 86400; }
start() {
  if (TimeCurrent() >= alert.when) {
    Alert(...);
    alert.when = TimeCurrent() + 30 * 86400; 
  }
 
Thank you very much for your simple, intelligent and very useful code.