Time Window Node

The Time Window node decides when a signal may fire: the first hour, outside lunch, Tuesdays only. Its modes, its two clocks, how it reads futures sessions, and how it differs from the Daily Time Window.

NodeBy AlgoLiftUpdated 6 min read
On this page 11How it worksThe two clocksSunday night is MondayTimes that move with the sessionExample: morning entries, flat by 15:45Not the same as the Daily Time WindowSettingsOutputsUse something else whenWhen it doesn't behaveGoing further

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:

ModeTrue whenFor example
BetweenInside any of the ranges09:30 to 11:00, and again 14:00 to 15:30
OutsideOutside all of themEverything except 12:00 to 13:30
FromFrom a time until the trading day endsFrom 10:00
UntilFrom the start of the trading day to a timeUntil 15:45
All dayAlways, on the days you pickNo 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 nodeDaily Time Window (a run setting)
DecidesWhen an entry may startWhen a position may be held
At its endNothing happens to open tradesEvery open position is closed
LivesOn the canvasIn 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

Mode
Default Between
Between, Outside, From, Until or All day.
Ranges
Default 09:30 to 16:00
Up to three, each a start and an end in New York time. An edge can be a clock time or anchored to the open or close.
Days
Default Monday to Friday
The weekdays it's open, counted by trading day.
Clock
Default Bar close
Bar close judges each bar when it closes. Intrabar judges the exact moment of each trade.
Counted series
Default Primary series
Whose bars the Bar close clock counts. It only matters when the strategy reads two timeframes. Pick a series and it stays put when you change the primary; pick Primary series and it follows.

Outputs

Active
True or false
True inside the window, on an allowed day.
Minutes in
Number
How long the window has been open. Empty outside it. Under More outputs.
Minutes left
Number
How long until it closes. Empty outside it. Under More outputs.

Use something else when

Trades should close at a time
A Time Window never closes anything. The bracket's Time exit does, at a clock time or a set number of minutes before the close.
A trade should last at most N minutes
The Time exit's "after N minutes" (or bars) option, counted from the fill.
Wait a while after the last exit
The Entry's Cooldown waits a set time, a number of bars, until the next trading day, or until a condition re-arms it.
Measure time since an event
Minutes or bars since an entry, an exit, a losing exit or the session open.

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.

Or ask the copilot