Execute buylimit/selllimit at every whole hour | half hour | 15 min

 

Hi! I'd like to write an expert advisor which would execute my limit orders at every whole hour, for example at seven, eight, nine and so on in the morning. In backtest, my robot has been profitable when i tested it with "prices only" method, but with "tick" method it hasn't really worked the way i was expecting it. I think that the difference between the results of the already mentioned methods was caused by the differing executing time. I would really appreciate your help! How could i fix it? I'm a newbie in MQL4 so please write in details.

Thanks for your help and time!

 
https://book.mql4.com/
 
int start(){
   static datetime Time0;
   if (Time0 == Time[0]) return; Time0 = Time[0];
   // start of a new bar.
Reason: