The thread is very old, still I want comment, that dates are in UTC so to find the first hour of a trading session, you HAVE to use the localized functions, like lhour(). Please think of day light saving, most timezones use that, but UTC not.

Jcl said that in the middle of this tread, but it was ignored, so watch for that if you are using this kind of strategy.