Momentum OscillatorsPine Script v6

ta.rci()Rank Correlation Index

The Rank Correlation Index measures the correlation between price rankings and time rankings.

Syntax

Syntax
ta.rci(source, length) → series float

Arguments

ParameterTypeDescription
sourceseries int/floatSeries whose ranks are compared to time ranks.
lengthseries intWindow length for rank correlation.

Returns

Rank Correlation Index.

Remarks

None.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.rci")
plot(ta.rci(close, 14))

Trading Applications

Identify trend strength using rank correlation

Detect overbought/oversold conditions on a -100 to +100 scale

Generate signals from extreme readings

Use multiple timeframe RCI for confluence

Related Functions

Frequently Asked Questions

ta.rci() returns the Rank Correlation Index, a momentum-style oscillator derived from Spearman-style rank correlation between ordered time and ordered price over length bars.

RSI is based on smoothed gain/loss ratios. RCI is based on rank ordering within the window, making it more robust to some outliers but interpreting differently.

RCI often uses a -100 to +100 style scale; traders watch extremes as context for stretched conditions, calibrated per instrument.

Generate ta.rci() Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.rci() and other built-in functions instantly.