Documentation/AlgoCode/Function reference

on

Read a series from another timeframe (multi-timeframe).

Reference/Language/Language

expr on 1h

Evaluates the expression on a higher timeframe and keeps the last fully closed higher-timeframe bar. The value stays constant until the next higher-timeframe bar closes. on 1D, on 1W, and on 1M use the script timezone: a calendar day, a Monday-start week, and a calendar month. Shorter frames such as 5m and 1h stay fixed durations from the Unix epoch. When the chart timeframe is finer, Dovee aggregates from chart candles. When the requested TF is finer than the chart, Run can fetch sibling candles for the same symbol.

Return value

Series aligned to the chart bars

Note

  • Scripts still run on closed chart bars.
  • Trail stops and SL/TP hits use OHLC only — intrabar order is not known.

Example

trend = ema(close, 50) on 1h
rsiHigher = rsi(close, 14) on 15m
when close > trend and rsiHigher > 50
  buy

See also