Re: https://www.mql5.com/en/forum/136275/page3#532562
I got my php working as a Cron job. I created a simple EA to send the file via FTP and set the Cron job (I use cPanel based hosting) to run every 2 mins.
The php . . .
The EA
It's all a little rough round the edges, I will make the php a little more configurable so it's easier to use with different time zones . . . but it works so far.
Re: https://www.mql5.com/en/forum/136275/page3#532562
I got my php working as a Cron job. I created a simple EA to send the file via FTP and set the Cron job (I use cPanel based hosting) to run every 2 mins.
The php . . .
The EA
It's all a little rough round the edges, I will make the php a little more configurable so it's easier to use with different time zones . . . but it works so far.
Hi,
Nothing new since 2011 ?
Can we add to send SMS ?
With my web hosting I can only run a cron one time / hour.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Re: https://www.mql5.com/en/forum/136275/page3#532562
I got my php working as a Cron job. I created a simple EA to send the file via FTP and set the Cron job (I use cPanel based hosting) to run every 2 mins.
The php . . .
<?php $to = "your@email.com"; $subject = "EA is silent"; $body = "EA has stopped responding . . . "; $minutes = 3; // max allowable age of file in mins $file = '/home/crum/public_html/ea/cron.txt'; $filetime = filemtime($file); $max_age = time()-($minutes * 60); // max age of file in seconds since Jan 1970 // print "File: $file Filetime: $filetime twomins: $timetwomins"; if ($filetime < $max_age && ( ( date(w) > 0 && date(w) < 5 ) || ( date(w) == 5 && date(G) < 22 ) || ( date(w) == 0 && date(G) > 22 ) ) ) { mail($to, $subject, $body); } ?>
The EA
It's all a little rough round the edges, I will make the php a little more configurable so it's easier to use with different time zones . . . but it works so far.