ta.valuewhen

Value of source on the bar where condition was true, occurrence times back (0 = most recent).

ta.valuewhen(condition: bool, source: any, occurrence: simple int) -> series any

Parameters

Example

lastCrossPrice = ta.valuewhen(ta.crossover(close, ta.sma(close, 20)), close, 0)