count
forge.signalsfunctionSince Forge API 1
Signaturepython
forge.signals.count(condition: np.ndarray | ConditionTree,/,*,over: int) -> np.ndarrayThe number of bars among this bar and the over - 1 before it where the condition is true.
Parameters
| Name | Type |
|---|---|
| condition | np.ndarray | ConditionTree |
| over | int |
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.