Reference: Other bars

Vex reference: other bars.

For AI tools: this page as Markdown · the whole language in one file

NameWhat
timeframex worked out on another timeframe of this chart's market (1m, 2m, 5m, 15m, 30m, 1h, 2h, 4h, 1D, 1W). Each bar reads the value of the last bar of that timeframe that had closed by its own close, so history never repaints; the newest bar follows the one still forming.
symbolx worked out on another market's bars (its own timeframe with timeframe =), lined up with this chart's bars the same way: no lookahead. Another market is drawn in its own pane.

timeframe

1timeframe("4h", x)

x worked out on another timeframe of this chart's market (1m, 2m, 5m, 15m, 30m, 1h, 2h, 4h, 1D, 1W). Each bar reads the value of the last bar of that timeframe that had closed by its own close, so history never repaints; the newest bar follows the one still forming.

Returns: a number per bar

In Pine Script: request.security(syminfo.tickerid, "240", x)

Example

1name("4h EMA", where = chart)2 3plot(ema(close, 20), "EMA 20")4plot(timeframe("4h", ema(close, 20)), "EMA 20 on 4h", color = orange, style = steps)

See also: Other timeframes and markets, symbol

symbol

1symbol("ETHUSDT", x, timeframe = "4h")

x worked out on another market's bars (its own timeframe with timeframe =), lined up with this chart's bars the same way: no lookahead. Another market is drawn in its own pane.

Returns: a number per bar

In Pine Script: request.security("ETHUSDT", timeframe.period, x)

Example

1name("BTC in ETH")2 3eth = symbol("ETHUSDT", close)4plot(close / eth, "BTC / ETH")

See also: Other timeframes and markets, timeframe