count_true

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

How many of this bar and the bars - 1 before it the condition was true on, as whole numbers. A bar with fewer bars behind it counts the bars that exist.

Parameters

NameType
conditionnp.ndarray | ConditionTree
barsint