A lot of strategies only make sense at certain hours. The open is fast and wide, lunch is thin, the overnight session is its own market. The Time Window node says when a signal is allowed to fire. It's true inside the hours and days you choose, false outside them, and you AND it into an entry like any other condition.
- Takes
- Nothing. It reads the exchange clock
- Gives
- True inside the window, plus minutes in and minutes left if you want them
- Reach for it
- Entries should only start at certain times, or on certain days
How it works
Every time in AlgoLift is New York time, written in 24 hours. A window of 09:30 to 11:00 means the first ninety minutes of the US cash session wherever you happen to live, and it moves with daylight saving exactly as the exchange does. You never convert anything.
You choose a mode, give it up to three ranges, and pick the days:
| Mode | True when | For example |
|---|---|---|
| Between | Inside any of the ranges | 09:30 to 11:00, and again 14:00 to 15:30 |
| Outside | Outside all of them | Everything except 12:00 to 13:30 |
| From | From a time until the trading day ends | From 10:00 |
| Until | From the start of the trading day to a time | Until 15:45 |
| All day | Always, on the days you pick | No trades on Fridays |
A range can run past midnight, so 18:00 to 09:30 covers the whole overnight futures session in one go. The node's Presets menu has the common ones ready (the opening hour, the midday lull, power hour, overnight, the Asia and London sessions).
The two clocks
This is the setting that changes results most often, so it's worth a minute.
With Bar close, the default, a bar belongs to the window if it closes inside it. On 5-minute bars, a window of 09:30 to 10:00 counts the bars that close at 09:35, 09:40 and so on up to 10:00, and each answer holds until the next bar closes. That's the right clock for most entries, because most signals are judged when a bar closes too. Clock and signal agree.
With Intrabar, the window judges the exact moment of every trade print instead. From 10:00 opens at 10:00:00, not at the first bar close after it. Use it when a window gates something that happens inside a bar: an exit, an intrabar crossover, or a cutoff that has to shut at an exact time.
Sunday night is Monday
Days belong to the trading day, not the calendar date. ES and NQ reopen at 18:00 on Sunday, and that session is Monday's. So a Monday-only window on futures includes Sunday evening, which is almost always what you want, and occasionally a surprise.
Times that move with the session
An edge can be tied to the session instead of the clock: "15 minutes after the open", "30 minutes before the close". Anchored edges follow the exchange calendar, so on a 13:00 half day, "30 minutes before the close" becomes 12:30 without you touching anything.
Example: morning entries, flat by 15:45
You trade a momentum entry on NQ 5m. Your notes say it works in the morning and falls apart after lunch, and you never want to carry a position into the close.
Add a Time Window, set it to Between 09:30 and 11:30 on the Bar close clock, and AND its output with the signal through a Logic node into the Entry. Then set the Bracket Order's Time exit to at 15:45.
Entries can now start on bars closing from 09:35 through 11:30, and anything still open at 15:45 is closed. A trade taken at 11:25 is free to run all afternoon; the window only decides when trades start.
Not the same as the Daily Time Window
AlgoLift has two ways to talk about hours, and mixing them up is the most common time mistake there is.
| Time Window node | Daily Time Window (a run setting) | |
|---|---|---|
| Decides | When an entry may start | When a position may be held |
| At its end | Nothing happens to open trades | Every open position is closed |
| Lives | On the canvas | In the run's settings |
"Only take trades from 9:30 to 11:00" is a Time Window: the 10:55 trade keeps running. "Be flat outside 9:30 to 16:00" is the Daily Time Window. Use both when you mean both.
Settings
Outputs
Use something else when
When it doesn't behave
My trades close the moment they open
That's a trade opened at or after the bracket's time exit. With a Time exit at 15:45, a trade that starts at 15:47 is already past its deadline, so it closes on the spot. Add an entry cutoff: a Time Window, Until 15:45, on the Intrabar clock, ANDed into the entry. (Bar close won't do it here. It counts the bar that closes at 15:45, and that bar's entry would fill right at the deadline.) The Inspector's checks spot this one and offer to end your entries at the exit time.
Entries start five minutes later than I set
That's the Bar close clock working as designed. On 5-minute bars, From 10:00 first opens at the 10:05 close, because the bar closing at 10:00 began at 09:55. If the time itself is the signal (enter at 10:00, full stop), switch the window to Intrabar.
My Monday strategy trades on Sunday
On futures it should. The session that opens at 18:00 on Sunday belongs to Monday's trading day. If you only want Monday's cash hours, add a range such as 09:30 to 16:00.
The strategy never takes a trade
Check that the window overlaps the run's Daily Time Window. If entries are allowed 08:00 to 09:00 but positions may only be held from 09:30, nothing can ever get through. The Inspector's checks flag this one before you run.
Going further
Minutes left turns "only enter if there's at least 20 minutes of the window to go" into one Comparison, which keeps late, rushed entries out of a short window.
Be careful about optimizing times. Sweeping a window's start and end is a search over the time of day, and it's one of the easiest ways to fit noise: some half hour will always look best in hindsight. Every window you try counts against the project's search budget, so if you sweep at all, use wide steps and a reason you could explain beforehand.