All indicators

Correlation Trend Indicator

By LuxAlgoJul 22, 2026

Correlation Trend Indicator is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

Correlation Trend Indicator scores how closely the recent window of price resembles a straight line, implementing the 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.

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

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans
Original indicatorBuilt in-house by LuxAlgo

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.