bars_since

forge.signalsfunctionSince Forge API 1
Signaturepython
forge.signals.bars_since(condition: np.ndarray | ConditionTree,/) -> np.ndarray

For each bar, how many bars ago the condition was last true: 0 on a bar where it is true, and -1 before the first time it is.

Parameters

NameType
conditionnp.ndarray | ConditionTree