barssince
forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.barssince(condition: ArrayLike) -> np.ndarrayHow many bars ago the condition last held: 0 on a bar where it holds.
Parameters
| Name | Type |
|---|---|
| condition | ArrayLike |
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)).