Metadata / Reference
alerta.time_close
TradingView-compatible spelling: time_close, runs without warnings
Returns the bar's close time (epoch milliseconds): open + timeframe, calendar months for monthly bars, and the session close for a stock's daily bar. Also usable as a bare built-in variable. Takes the same optional arguments as `time`: with a timeframe, `time_close("D")` is the close of the higher-timeframe bar the current bar belongs to; with a session, the value is the close time inside the session window and `na` outside.
alerta.time_close() or time_close(timeframe, session?, timezone?, bars_back?, timeframe_bars_back?) → series intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
timeframe | simple string | No | — | Optional resolution to evaluate the close time at. |
session | simple string | No | — | Session spec, e.g. "0930-1600". When present, returns na outside the session window. |
timezone | simple string | No | — | IANA name, "UTC", or "GMT±N". Defaults to UTC. |
bars_back | series int | No | — | The close of the chart bar N back (a negative N reads the bar N ahead; past the last loaded bar the chart's timeframe steps on). |
timeframe_bars_back | series int | No | — | The close of the `timeframe` bar N back from the one holding the chart bar (negative: ahead). Not combined with a session. |
Returns
series intExample
alerta.time_close
plot(time_close(), { pane: "oscillator" })plot(nz(time_close("D"), time), { title: "session close", pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.