Ref
- reference past/future values of the array

Trading system toolbox


SYNTAX Ref( ARRAY, period )
RETURNS ARRAY
FUNCTION References a previous or subsequent element in a ARRAY. A positive period references "n" periods in the future; a negative period references "n" periods ago. The function accepts periods parameter that can be constant as well as time-variant (array).
EXAMPLE The formula "ref( CLOSE, -14 )" returns the closing price 14 periods ago. Thus, you could write the 14-day price rate-of-change (expressed in points) as "C - ref( C, -14 )." The formula "ref( C, 12 )" returns the closing price 12 periods ahead (this means looking up the future)
SEE ALSO  

References:

The Ref function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.