Compound Indicators (Indicators of Indicators)

Consecutive Decrease indicator

Number of consecutive completed calendar periods (America/New_York; period is Year, Quarter or Month), ending with the last completed period, whose closing value of the inner indicator was strictly hi

Definition

Number of consecutive completed calendar periods (America/New_York; period is Year, Quarter or Month), ending with the last completed period, whose closing value of the inner indicator was strictly higher (ConsecutiveIncrease) or strictly lower (ConsecutiveDecrease) than the previous period's closing value. A period's closing value is the inner indicator's last non-null value observed in that period. The in-progress current period never counts, equal values are not a change, and a completed period with no value breaks the streak. The count is capped at lookback (an integer from 1 to 60). Returns null when no completed period has a value.

Parameters

Inner indicator, Period (Year, Quarter or Month), Lookback (1–60)

Output range: 0 to lookback, or null when no completed period has a value

Example condition

text
`ConsecutiveDecrease(LastDividend(T), Year, 3) >= 1` (T's regular dividend per share fell in the last completed year); `ConsecutiveDecrease(Fundamental(INTC, totalRevenue), Quarter, 8) >= 3` (INTC's reported revenue fell for the last 3 completed quarters)

Usage notes

Use it as an exit or exclusion filter, for example selling a holding whose dividend was cut or whose revenue has shrunk several quarters in a row.

Use in a strategy

Add this indicator to a strategy condition, choose its supported parameters and compare the output with the threshold required by your rule. Preserve the same interval and lookback when comparing backtests.

After saving the condition, inspect its asset, interval, lookback and comparison operator against the parameters above. If no trades occur, check whether the condition ever became true and whether the requested input data exists for that period. A missing input is not a zero-valued signal. An indicator produces an input to a rule. It does not establish future returns, and data availability can differ across assets and periods.