valuewhen
forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.valuewhen(condition: ArrayLike,source: ArrayLike,occurrence: int = 0) -> np.ndarrayThe source on the bar where the condition last held, or the occurrence-th time before.
Parameters
| Name | Type | Default |
|---|---|---|
| condition | ArrayLike | |
| source | ArrayLike | |
| occurrence | int | 0 |
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).