Lots of ways. Here is one:
int OnInit() { EventSetTimer(1); return(INIT_SUCCEEDED); } ..... void OnTimer() { static int LastHour=-1; int ThisHour=TimeHour(TimeLocal()); if(ThisHour!=LastHour) { SendMail("My Subject","My Message"); LastHour=ThisHour; } }
Check the current time vs the last sent time; no loop required.
Great thanks
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Does anyone know how I could send email alerts at certain times?
I am looking to do this every hour, the Sendmail function is easy enough but I'm stuck on a Time loop?
Thank you in advance