EA function Question..

 

Hi,

Im looking at the daily candles.

Is there a simple way of knowing (via code) what time of the day, the broker forms new daily candles? I know it varies by Broker..

Its prob obvious, and Im missing it..

 

Look at the timelocal() function.

It looks at your computer clock, so if you know the difference between your computer clock and GMT, you can calculate your broker's shift.

 

here ya go

int dayBarHour(){ //returns the hour the bar was formed

return(TimeHour(iTime(Symbol(),1440,0)));

}
Reason: