Download MetaTrader 5
To add comments, please log in or register
Share the links to products and make your profit
Keith Watford
Moderator
9418
Keith Watford 2015.05.06 22:32  
read1985:
Any ideas? :)

Well, it seems that TimeCurrent() is not updated quickly enough

Could this be a workaround?

   if(IsConnected()==false)
     {
      return(0);
     }
   static bool first_ticks=true;
   static datetime TC=TimeCurrent();
   if(first_ticks)
      if(TC==TimeCurrent())
         return(0);
   first_ticks=false;
   if(TimeDayOfYear(TimeCurrent())!=TimeDayOfYear(iTime(Symbol(),PERIOD_D1,0)))
      return(0);

 It should mean that when you start the terminal it will wait for the time to update. If this doen;t work, then I don't expect to have any further suggestions.

Richard Read
322
Richard Read 2015.05.07 03:00  
Thanks GumRai, will test it out!
Richard Read
322
Richard Read 2015.05.08 03:14  

Ok so it didn't give any of the previous days results which is good! But I can't test conclusively as there we no alerts produced today. But id does seem to be working, I will know for sure on Tuesday!

 

Thanks GumRai! 

Richard Read
322
Richard Read 2015.05.13 03:35  
Seems to be working 100% now, thanks GumRai! :)
Richard Read
322
Richard Read 2015.05.14 04:02  

No I lie!

 

It now doesn't show the previous days alerts as well as today's alerts, but I need to open the client twice to get all of todays alerts.

So the first time I open the client, I will get 1 alert. Then when I close and open it again, I get the original correct alert plus the rest of the alerts for the day.

 

Weird?

 

Richard 

/ /123
To add comments, please log in or register