barssince

forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.barssince(condition: ArrayLike) -> np.ndarray

How many bars ago the condition last held: 0 on a bar where it holds.

Parameters

NameType
conditionArrayLike

Before the first bar where it holds there is no value. A number array counts as true where it is not 0, so an event array works too. Example: ta.barssince(ta.crossover(fast, slow)).