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
- The functions can be used to shift static or dynamic series
under certain conditions or in a
tick or tock function.
Dynamic series are otherwise automatically shifted at any time frame.
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