Time of Day¶
Time · Window
Boolean signal — true on bars whose UTC time falls within the [start, end] window. Window crossing midnight is supported: start=22:00, end=02:00 means 'late evening into early morning.' Use AND with an entry signal to constrain strategies to specific times of day.
Time of Day emits true only on bars whose UTC time falls inside a window you define — from a start hour:minute to an end hour:minute. It's the precise, custom version of Session Filter: use it to trade only during the hours that suit your strategy, or to avoid specific times like the chaotic minutes around a major news release or the thin hours near the daily rollover.
How it works¶
You set Start hour/minute and End hour/minute (default 08:00–17:00 UTC), and the block outputs true on every bar inside [start, end]. Windows that cross midnight are supported — start = 22:00, end = 02:00 means "late evening into early morning," which the block handles correctly rather than producing an empty window. Timestamps are read as UTC, and the Bars input aligns the signal to your timeframe. And the In window output with your entry logic to constrain it.
When to use it¶
Use Time of Day for any time-based constraint that isn't a standard session: trading only the first two hours after the London open, avoiding the low-liquidity window around 21:00–22:00 UTC, or sitting out a recurring news hour. It's also the tool for restricting intraday strategies to their best-performing hours once you've found them (carefully — slicing by hour invites curve-fitting). For the common forex sessions, Session Filter is the quicker pick.
Example¶
Trade only the post-open hours: wire Bars into Time of Day with 08:00–12:00, then And the In window output with your entry into a Buy Signal — restricting entries to the morning's activity. Backtest in the Tester.
Tips & gotchas¶
- UTC, always — convert your local/session times to UTC when setting the window.
- Midnight-crossing windows work —
22:00→02:00is a valid overnight window. - And it with entries — it's a gate, not a trigger.
- Beware hour-slicing curve-fits — "only trades well at 09:00" on past data is a red flag; validate out-of-sample.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| Bars | bars |
Bars to align the signal to (timestamps read as UTC). |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| In window | signal |
Signal arrows | True on bars inside the chosen window. |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| Start hour | number · 0–23 | 8 |
|
| Start min | number · 0–59 | 0 |
|
| End hour | number · 0–23 | 17 |
|
| End min | number · 0–59 | 0 |
Reference auto-generated from the block catalog · category Time.