Skip to main content

Consecutive Above Threshold

Quick Reference

PropertyValue
Dimensionstability
Categorystatistics
Versionv1.0
Output Columnconsecutive_duration

Duration of consecutive observations above a threshold 鈥?measures regime persistence

Formula

rolling_sum(signal, 100)

CDM Inputs

ColumnCDM TableDescription
signalcdm_*CDM source table

Parameters

ParameterTypeDefaultDescription
thresholdfloat0.5Threshold value for counting

Output

Column: consecutive_duration

Count of consecutive observations above threshold

Market Intuition & Trading Rationale

Consecutive above threshold measures how long a signal stays elevated: the count of consecutive observations exceeding a threshold. This captures regime persistence 鈥?a signal that stays above threshold for 100 consecutive observations indicates a sustained regime; a signal that briefly spikes above threshold and immediately drops indicates a transient event. The duration of elevation is often more informative than the magnitude.

This feature separates genuine regime shifts from noise. In a toxicity signal, a single VPIN spike to 0.9 may be noise; VPIN above 0.7 for 50 consecutive observations is a genuine toxic regime. The threshold parameter should be calibrated to each signal's distribution 鈥?typically set at the 75th or 90th percentile of historical values.

Usage Cases

  • Regime confirmation: Only act on signals after they've been above threshold for a minimum consecutive duration (e.g., 10 observations). This filters out false positives from transient spikes.
  • Exit timing: Exit a position when the signal drops below threshold after a sustained period above 鈥?the regime has ended. The duration of the above-threshold period provides confidence in the regime call.
  • stability context: Used in volatility_regime_transition pack 鈥?consecutive duration of elevated volatility probability confirms whether a vol regime shift is genuine or a false alarm.

YAML Definition

name: consecutive_above_threshold
description: Duration of consecutive observations above a threshold 鈥?measures regime
persistence
category: statistics
dimension: stability
version: v0.9.0 (Beta)
required_inputs:
- signal
output_column: consecutive_duration
output_description: Count of consecutive observations above threshold
tags:
- stability
- duration
- statistics
parameters:
threshold:
type: float
description: Threshold value for counting
required: false
default: 0.5
formula: rolling_sum(signal, 100)