count

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

The number of bars among this bar and the over - 1 before it where the condition is true.

Parameters

NameType
conditionnp.ndarray | ConditionTree
overint

count(rsi > 50, over=3) >= 3 means above 50 for the last three bars. A comparison of the result gives a True/False array, so it combines like any condition.