ValueWhen
- get value of the array when condition met

Trading system toolbox
(AFL 1.1)


SYNTAX ValueWhen(EXPRESSION, ARRAY, n = 1)
RETURNS ARRAY
FUNCTION Returns the value of the ARRAY when the EXPRESSION was true on the n -th most recent occurrence. Note: this function allows also 0 and negative values for n - this enables referencing future
EXAMPLE valuewhen( cross( close, ma(close,5) ) ,macd(), 1)
SEE ALSO

References:

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

More information:

Updated on-line reference