diff (var x): var

Returns the difference of x to its value from one bar before.

Parameters:

x Variable for difference calculation.

Returns

x - previous x

Remarks

Example:

// generate a price difference serie
vars Changes = series(diff(priceClose()));

See also:

series, rev, ROCP

► latest version online