# Change-Point Detection (CUSUM)

A statistical regime detector that standardizes log-returns and accumulates meaningful deviations CUSUM-style until a threshold confirms a structural shift. Regime lines, pressure bands, and change-point markers show market stability and stress in real time, without repainting. Aimed at systematic traders who want regime turns flagged before lagging averages react.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Feb 17, 2026.
- Access: free.
- Concepts: [Change-point Detection](https://www.luxalgo.com/library/concept/change-point-detection/) (primary), [Outlier Detection](https://www.luxalgo.com/library/concept/outlier-detection/), [Trend Regime Label](https://www.luxalgo.com/library/concept/trend-regime-label/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn0u960013vhsg0gcbfoqi
- Page: https://www.luxalgo.com/library/indicator/change-point-detection-cusum/

**Change-Point Detection (CUSUM)** hunts for the bar where a market's statistical behavior actually changes. A modified cumulative-sum procedure (the workhorse of [change-point detection](https://www.luxalgo.com/library/concept/change-point-detection/) in quality control) standardizes log-returns into z-scores, the same yardstick used in [outlier detection](https://www.luxalgo.com/library/concept/outlier-detection/), and accumulates every deviation that clears a slack filter. When the accumulated pressure crosses a statistical threshold, a new regime is confirmed at that price, no moving-average lag involved.

## How to Trade the Change-Point Detection (CUSUM)?

- **Green regime line**: bullish regime; the line marks the price where the last change-point confirmed and serves as the structural baseline.
- **Red regime line**: bearish regime, the same logic mirrored.
- **Pressure bands (sPos and sNeg)**: shaded accumulation against the current regime. Steady growth signals instability building before any flip.
- **Triangle markers**: pressure exceeded the threshold; the regime flips, the accumulators reset, and a new baseline prints.

Trade fresh regimes directionally, trim exposure as opposing pressure swells, or let the regime state pick between trend-following and mean-reversion playbooks. Confirmed change-points do not repaint.

## Change-Point Detection (CUSUM) Settings

- **Lookback Period**: rolling window for the mean and standard deviation; shorter reacts faster, longer stabilizes detection.
- **Threshold (h)**: pressure required to confirm a change-point. Higher values favor durable structural shifts, lower values catch shorter rotations.
- **Slack (k)**: minimum deviation before anything accumulates; raising it filters sideways noise and premature triggers.
- **Dashboard**: enable the readout and set its position and size.

## Frequently Asked Questions

### Is this a trend-following or mean-reversion tool?

Neither, strictly. It is a regime detector. Trend traders enter with newly confirmed regimes, mean-reversion traders look for opportunity inside a stable one, and systematic traders use the state to pick which system is active.

### Why standardize returns instead of using raw price?

Standardization makes the accumulators volatility-adjusted and scale-free, so the same threshold and slack behave consistently on a currency pair, an index, or a single stock. Sensitivity comes from your parameters, not from the instrument's price level.

### How can I use the Change-Point Detection (CUSUM) indicator?

It is free for everyone in the LuxAlgo Library, and Quant, our coding agent, can run it straight from this page. Pair it with [Volatility Regime Switches](https://www.luxalgo.com/library/indicator/volatility-regime-switches/) if you want a volatility-focused regime read beside this return-based one. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [HyperTrend](https://www.luxalgo.com/library/indicator/hypertrend/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/hypertrend.md
- [Trending Market Toolkit](https://www.luxalgo.com/library/indicator/trending-market-toolkit/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/trending-market-toolkit.md
- [Precision Market Entropy Heatmap](https://www.luxalgo.com/library/indicator/precision-market-entropy-heatmap/) (Entropy Measures): markdown at https://www.luxalgo.com/library/indicator/precision-market-entropy-heatmap.md
- [Chaos Weighted RSI](https://www.luxalgo.com/library/indicator/chaos-weighted-rsi/) (Fractal Dimension): markdown at https://www.luxalgo.com/library/indicator/chaos-weighted-rsi.md
- [Hurst Exponent](https://www.luxalgo.com/library/indicator/hurst-exponent/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/hurst-exponent.md
- [Spline Quantile Regression Channel](https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel.md
- [Reversal Probability Zone & Levels](https://www.luxalgo.com/library/indicator/reversal-probability-zone-levels/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/reversal-probability-zone-levels.md
- [Predictive Monte Carlo Engine](https://www.luxalgo.com/library/indicator/predictive-monte-carlo-engine/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/predictive-monte-carlo-engine.md

---

Source: https://www.luxalgo.com/library/indicator/change-point-detection-cusum/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
