• the reference valuewhen(cond, source, occurrence): the value of source the n-th most recent time cond was true, counting the current bar. Occurrence 0 is the latest. An occurrence that is not a whole number of 0 or more gives NaN throughout, and so does a hit past the end of a shorter source.

    Parameters

    • cond: readonly boolean[]
    • source: readonly number[]
    • occurrence: number

    Returns number[]