offset

Offset (LAG) function for time-shifting values

offset(source, amount)

Parameters

Name Type Description
source field Data series to shift
amount float Number of bars to shift

Formula

offset(source, amount) = LAG(source, amount)

Examples

// yesterday's close via explicit offset() call
offset(close, 1) < close;

Returns

field

Range

amount must be 1-400

Notes

Internally created when parsing bracket-offset syntax such as close[5] or an indicator call's trailing [N], e.g. sma(close, 20)[1]