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
| Setting | Default | Range | What it does |
|---|---|---|---|
| window | UTC|00:00|01:00|mon,tue,wed,thu,fri,sat,sun | The 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_bars | 300 | 1 to 5000 | Candles replayed at start so the prior session is known (at least one day of the node's timeframe: 5m = 288). |
What it gives
| Output | What it is |
|---|---|
| In the window | True while the candle is inside the window. |
| Window open | True on the first candle of the window. |
| Window high so far | High of the window so far (provisional). |
| Window low so far | Low of the window so far (provisional). |
| Window range high | High of today's window, from its close to the day's end. |
| Window range low | Low of today's window, from its close to the day's end. |
| Window open price | The window's first open (while it runs, then until the day's end). |
| Window close price | The window's latest close (while it runs, then its last close until the day's end). |
| Window close | True 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