# Correlation Trend Indicator

Correlation Trend Indicator is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

John Ehlers' Correlation Trend Indicator computed as published: the Pearson correlation of the source against an ideal rising line across a 20-bar window, bounded between -1 and +1. Readings beyond the 0.5 threshold mark bullish or bearish trend regimes with an optional background tint, and alerts cover regime starts, the trendless state, and zero crosses.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jul 22, 2026.
- Access: free.
- Concepts: [Correlation Trend Indicator](https://www.luxalgo.com/library/concept/correlation-trend-indicator/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=sq3v6v8d4cdktbtp76pk3vhi
- Page: https://www.luxalgo.com/library/indicator/correlation-trend-indicator/

**Correlation Trend Indicator** scores how closely the recent window of price resembles a straight line, implementing the [Correlation Trend Indicator](https://www.luxalgo.com/library/concept/correlation-trend-indicator/) exactly as defined: a Pearson correlation computed over 20 bars between the source and an ideal rising line. Readings near +1 mean the window tracked a steady advance, readings near -1 a steady decline, and the plot flips color at zero with a gradient fill toward the reading. Dashed thresholds at plus and minus 0.5 and dotted bounds at plus and minus 1 frame the scale.

## How to Trade the Correlation Trend Indicator?

- **Above the Trend Threshold (+0.5)**: a bullish trend regime. The background tints, marking stretches where trend-following logic applies.
- **Below -0.5**: the bearish mirror; regime alerts fire on entry to either state.
- **Inside the threshold band**: a trendless window. The regime background clears and a dedicated alert marks the return to neutral.
- **Zero crosses**: sign changes arrive after the turn, lagging by a fraction of the window; optional circles mark them on the zero line.

As a bounded, scale-free regime gauge it slots cleanly into the [trend family](https://www.luxalgo.com/library/family/trend/).

## Correlation Trend Indicator Settings

- **Length** (default 20): lookback correlated against the ideal rising line; it sets the trend scale being measured; other lengths score other swings and need not agree.
- **Source** (default close): the series being scored.
- **Trend Threshold** (default 0.5): magnitude treated as a meaningful trend; the regime states and their alerts key off it.
- **Regime Background** (default enabled): tints the pane while the reading holds beyond the threshold.
- **Zero Cross Markers** (default disabled): circles at sign changes; the cross alerts fire either way.

## Frequently Asked Questions

### CTI or the R-squared trend fit?

Squaring CTI yields the R-squared of the same regression while discarding the sign, so [R-Squared Trend Fit](https://www.luxalgo.com/library/indicator/r-squared-trend-fit/) measures strength alone, and CTI folds strength and direction into a single bounded reading. Choose CTI when a single pane must answer both questions.

### What lookback should I use?

The window defines the swing being scored, and half the period of interest is a common convention. No single value is right everywhere: a 20-bar and a 100-bar CTI can disagree legitimately because they describe different trends on the same chart.

### Does a reading near +1 predict continuation?

No. Like every windowed statistic it is entirely backward-looking, describing the last 20 bars rather than the next 20. Its job is honest regime classification: saying when a trend-following playbook applies, not forecasting where price goes.

## Related indicators

- [Structure & Trend Dashboard](https://www.luxalgo.com/library/indicator/structure-trend-dashboard/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/structure-trend-dashboard.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
- [Change-Point Detection (CUSUM)](https://www.luxalgo.com/library/indicator/change-point-detection-cusum/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/change-point-detection-cusum.md
- [HyperTrend](https://www.luxalgo.com/library/indicator/hypertrend/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/hypertrend.md
- [HTF Candle Consistency](https://www.luxalgo.com/library/indicator/htf-candle-consistency/) (Higher-timeframe Trend Filter): markdown at https://www.luxalgo.com/library/indicator/htf-candle-consistency.md
- [Average Directional Index](https://www.luxalgo.com/library/indicator/average-directional-index/) (ADX / DMI System): markdown at https://www.luxalgo.com/library/indicator/average-directional-index.md
- [Anchored Powered KAMA](https://www.luxalgo.com/library/indicator/anchored-powered-kama/) (Kaufman Efficiency Ratio): markdown at https://www.luxalgo.com/library/indicator/anchored-powered-kama.md
- [Trend Intensity Index](https://www.luxalgo.com/library/indicator/trend-intensity-index/) (Trend): markdown at https://www.luxalgo.com/library/indicator/trend-intensity-index.md

---

Source: https://www.luxalgo.com/library/indicator/correlation-trend-indicator/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
