Download MetaTrader 5

Help with Ichi Alert Indicator - page 3

To add comments, please log in or register
Keith Watford
Moderator
10569
Keith Watford  
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
337
Richard Read  
Thanks GumRai, will test it out!
Richard Read
337
Richard Read  

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
337
Richard Read  
Seems to be working 100% now, thanks GumRai! :)
Richard Read
337
Richard Read  

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