Timing · condition block
Time of day (UTC)
The time of day block is true when the candle's open time falls inside a window of hours in UTC. Use it to trade only during sessions you care about, such as the European or US hours.
How the engine evaluates it
The engine reads the hour (0–23, UTC) of the candle's open time. The window includes both ends: hour 8..16 is true for candles opening from 08:00 through 16:59.
If the start is after the end, the window wraps past midnight: hour 22..4 covers 22:00 to 04:59.
On 4-hour and daily candles the open hours are coarse: daily candles all open at 00:00 UTC.
Botscript syntax
In the Lab you pick this block from the Timing group and fill in its fields. In the code view the same condition is written like this:
hour 8..16
hour 22..4
Settings
| Setting | Values | Default | Notes |
|---|---|---|---|
| Start hour | 0 – 23 | 8 | UTC. |
| End hour | 0 – 23 | 16 | UTC, inclusive. |
How traders use it
- Session filters:
hour 13..20for US trading hours. - Avoid thin hours:
not hour 0..5.
Example bot
bot "US Session Dips"
when hour 13..20 and rsi(14) < 30
then buy 50%
when rsi(14) > 65
then sell 100%
- Buys oversold readings only during 13:00–20:59 UTC.
- Sells on strength at any hour.
Pitfalls
- Daylight saving time does not exist in UTC; local session hours shift by an hour twice a year.
- Hour filters on daily candles do nothing useful.
Time of day: frequently asked questions
Which time zone is used?
UTC, always. Convert your local session to UTC before setting the window.
Is the end hour included?
Yes. hour 8..16 includes candles that open at 16:00.
Can the window cross midnight?
Yes. A start hour later than the end hour wraps: hour 22..4.
Which time of the candle is used?
Its open time.
Related blocks
Simulated results are hypothetical. They include only the fee and slippage you set on the bot, not every real-world cost or market condition, and past performance does not guarantee future results. Nothing here is financial advice.