Change-Point Detection for Trading Regimes

A regime model is useful only if it reacts to a distribution change before the old model causes unacceptable losses. Change-point detection seeks timestamps where the parameters of a process—mean, variance, correlation, or microstructure behavior—shift. Unlike a fixed-state classifier, it explicitly asks whether the data-generating process has broken. It complements, rather than replaces, HMM regime detection.

Offline versus online detection

Offline methods segment a completed history and are ideal for research: penalized likelihood, binary segmentation, and dynamic programming find breaks that explain a series without fitting every wiggle. Online methods make a decision at time t with only information then available: CUSUM, Page-Hinkley, sequential likelihood ratios, or Bayesian online change-point detection (BOCPD).

DetectorSignalStrengthFailure mode
CUSUMMean shiftFast, transparentSensitive to volatility change
Variance CUSUMSquared residualsVolatility alarmsHeavy-tail false alarms
BOCPDPredictive likelihoodProbabilistic run lengthModel specification

A practical CUSUM alarm

Standardize returns or signal residuals by a point-in-time volatility estimate. Then accumulate deviations beyond a slack parameter k; signal when either side exceeds h.

import numpy as np

def cusum(z, k=0.5, h=5.0):
    up = down = 0.0; alarms = []
    for t, x in enumerate(z):
        up = max(0.0, up + x - k)
        down = min(0.0, down + x + k)
        if up > h or down < -h:
            alarms.append(t); up = down = 0.0
    return alarms

Calibrate k and h using false-alarm frequency under a simulated null and historical operational cost. A detector optimized to label every well-known crash perfectly is usually too late or too noisy for live use.

Trading design after an alarm

An alarm should trigger a policy, not an automatic reversal. Examples include reducing leverage, widening forecast uncertainty, shortening covariance windows, freezing model retraining, or switching to a robust fallback signal. Define a cool-down and a re-entry criterion; otherwise repeated alarms become a hidden discretionary strategy.

Detect breaks in the relevant variable. A trend strategy may tolerate a mean-return shift but fail when autocorrelation or transaction costs change. A market maker cares about spread, fill probability, cancellation rate, and adverse selection, not daily index volatility alone. Multivariate changes are difficult because correlations shift with sampling error; shrink or factorize first.

Validation traps

A labeled historical regime is not ground truth. Test alarms in walk-forward simulation, measure detection delay and false-alarm rate, and attach the exact action's P&L impact. Use embargoed cross-validation if labels overlap. A detector that correctly announces a break after the drawdown is complete has descriptive value but little risk-management value.

Implementation discipline

The model is only one layer of the trade. Store input timestamps, vendor identifiers, contract specifications, FX conversion conventions, and the exact version of each risk model alongside every signal. A result that cannot be reproduced from raw inputs is not a research result; it is an anecdote. Use point-in-time constituent data, distinguish an indicative quote from an executable quote, and make the decision clock explicit. For an execution-sensitive strategy, a close price or composite midpoint is usually an unattainable benchmark rather than a fill.

Evaluate the full distribution, not just a headline Sharpe: drawdown, tail loss, turnover, capacity, exposure concentration, and degradation during the stressed periods that motivated the idea. Split design, parameter choice, and final evaluation across separate samples. If alternatives were explored, record them and account for the search using the Deflated Sharpe Ratio. Finally, run a paper or shadow phase with the same order, reconciliation, and limit logic planned for production. A backtest should establish a conditional expectation, not a promise of a tradable return.

Key takeaways

  • Change-point detection tests for breaks rather than forcing every day into a fixed regime.
  • Choose online methods for actions and offline segmentation for research explanation.
  • Standardize inputs point-in-time and calibrate thresholds to economic false-alarm costs.
  • Pair each alarm with precommitted leverage, model, and re-entry actions.
  • Validate delay, false alarms, and P&L effects in a strict walk-forward design.
#change point detection #regimes #CUSUM #Bayesian online detection #machine learning