Hour of Bar[i]

 

Hello MQL4 comunity,


i need help and maybe some one might help me please.


I wan´t to draw an indicator which draws a value only at a given time. For exapmple only between 08:00 and 20:00h. But i gues not how to realize this.
I tried to do this with the Hour() function, but this function returns only the hour (0,1,2,..23) of the last known server time by the moment of the program start (this value will not change within the time of the program execution).


So what i would need is something like :


 
int    counted_bars=IndicatorCounted();
int limit=Bars-counted_bars;
 
for(int i=0; i<limit; i++)
  
   { int my_hour=Hour(i); }


Thank you for your help.

 

Use TimeHour(Time[i]) not Hour(i)

 
phy:

Use TimeHour(Time[i]) not Hour(i)

Thank you phy. I´ll try it.

 
JT2008:

Thank you phy. I´ll try it.

I tried it and it did work. Thanks again.