• 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.

    Parameters

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

    Returns number[]