Time window

Whether a candle is inside a time window you set, with the window's high and low (the opening range).

A local time window of an IANA time zone on chosen days. in_window while the candle is inside it; window_open on its first candle; current_high/low = the window so far; range_high/low = the window's high and low (the opening range) from its close until that local day ends, no value on other days or before the close. open / close = the window's first open and latest close while it runs, then its open and close over the same span as the range; window_close on its last candle (the one closing at the window end; capture a value on it for the value at that time). A candle that crosses the window start or end has no values.

Time window is a structure detector: it marks price structure on the chart and counts against the plan's detector limit.

Settings

SettingDefaultRangeWhat it does
windowUTC|00:00|01:00|mon,tue,wed,thu,fri,sat,sunThe window as time zone|start|end|days in local time, e.g. America/New_York|09:30|10:00|mon,tue,wed,thu,fri (an end before the start crosses midnight; days are the local days it starts on). Needs a timeframe of whole minutes that divides its times.
session_bars3001 to 5000Candles replayed at start so the prior session is known (at least one day of the node's timeframe: 5m = 288).

What it gives

OutputWhat it is
In the windowTrue while the candle is inside the window.
Window openTrue on the first candle of the window.
Window high so farHigh of the window so far (provisional).
Window low so farLow of the window so far (provisional).
Window range highHigh of today's window, from its close to the day's end.
Window range lowLow of today's window, from its close to the day's end.
Window open priceThe window's first open (while it runs, then until the day's end).
Window close priceThe window's latest close (while it runs, then its last close until the day's end).
Window closeTrue on the last candle of the window (it closes at the window end).

What it reads

It reads the whole candle (open, high, low, close and volume).

Warm-up

With its default settings, Time window needs 300 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.

Test it

Copy this sentence into the Algonney chat to backtest it:

Backtest a strategy on BTC that uses Time window with its default settings