# forge.ta.valuewhen

```python
forge.ta.valuewhen(condition: ArrayLike, source: ArrayLike, occurrence: int = 0) -> np.ndarray
```

The source on the bar where the condition last held, or the ``occurrence``-th time before.

``occurrence`` 0 is the most recent bar where the condition held, at or before the current bar.
There is no value until the condition has held ``occurrence + 1`` times, or when the source is
missing on that bar. Example: ``ta.valuewhen(ta.crossover(fast, slow), high)``.

Since Forge API 1.
