Code:
hour(0) is the same as hour(). It's the closing time of the current bar, and also the current time at the moment when the script is executed. The start time of the current bar would be hour(1).



Sorry jcl the limited brain is still confused.

In this example, we want the script to execute at some microseconds past 06:00 UTC. The current time when the script executes is not the same as the current bar, my understanding is that the current bar is bar zero, i.e. the most recently fully completed bar.

In the rest of zorro, bar number 0 is the bar just closed i.e. 05:00:00 to 06:00:00, so is the closing time of bar 0 = 06:00:00 and hour(0)=6?

However, where I get confused is because the current time the script is running is now in a new bar not fully formed you could say bar -1, running from 06:00:00 to 07:00:00, in that case the closing time of the bar the script is running in is 07:00:00 and should hour()=7?

So for our current script example is the correct statement to allow for daylight saving:

Code:
if (lhour(CET,0) == 8 or 9)






Last edited by swingtraderkk; 08/01/13 11:56.