shift (vars Data, var Value, int Length)

Shift the first Length elements of Data by one position, and fill Data[0] with Value

Parameters:

Data Series or array to be shifted.
Value New value for the first element.
Length Number of elements to be shifted. If negative, the array is shifted backwards.

Remarks

Example:

function run()
{
  ...
  vars Data10 = series(0,-10); // create a static series
  if(SomeCondition) shift(Data10,NewValue,10);
  ...

See also:

series, diff, rev, tick
 ► latest version online